System has not been booted with systemd as init system (PID 1). Can't operate (Ubuntu app on Windows 10)

1

My environment is Windows 10, ubuntu app (fresh install and update in last 24hrs)

python3.6.9 Working through the tutorial/demo below. Cannot start my service.

I have previously been able to start nginx as a service using sudo service nginx start

sudo systemctl start myproject

System has not been booted with systemd as init system (PID 1). Can't operate.

https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04

any ideas/suggestions?

aspiringGuru

Posted 2020-01-08T01:51:27.333

Reputation: 111

1Yeah, I don't think that post is made to confirm it works with Windows Subsystem for Linux and from what I read, there are all sorts of bug with trying to use systemd on WSL and Ubuntu in particular at that (not limited to tho). Perhaps you can figure out a way to start it not using systemd entirely and that may be a solution. I bet if you install Ubuntu as a VM and not a WIndows subsystem it would work though so those to two workarounds I can think of with quick research on your problem and the detail you've given. – Pimp Juice IT – 2020-01-08T02:40:22.710

This method looks like a path to a solution.

https://askubuntu.com/questions/1177273/wsl-ubuntu-is-there-an-easy-way-to-have-bash-start-automatically-on-windows-sta

the above method looks close to the solution needed.

parking my time on this problem. Hoping someone with more experience in this area can recognise if this solution method is viable.

– aspiringGuru – 2020-01-08T22:49:09.073

There's only one way to become a guru, and that's to aspire! The post from your question appears to basically be about running python via flash framework on Ubuntu but not from WSL in particular though. The ask Ubuntu post is about having WSL auto start with Windows scripting and Task Scheduler. The error in big bold on your question is related to the systemd running on Ubuntu from within the WSL subsystem. This question is about resolving the error, right? – Pimp Juice IT – 2020-01-09T01:47:56.333

yes.

for example, this does not work. sudo systemctl start myproject this does. sudo service nginx start I think the solution is in using windows task scheduler to auto start a windows shell script to launch a ubuntu bash script – aspiringGuru – 2020-01-10T01:41:32.040

I haven't played much with Linux on top of the Windows OS myself yet but am curious to hear if you confirm this works to resolve the problem you ask about originally. – Pimp Juice IT – 2020-01-10T02:09:29.563

No answers