-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't start a service #20
Comments
I finally got nginx started 🎉 I just opened the nginx service file ( /usr/bin/nginx -g 'pid /run/nginx.pid; error_log stderr;' It's probably possible to make a script that run services this way automatically. |
WSL does not support systemd / an init system, so you cannot use services. You have to run the commands yourself. |
We can't use service command on Arch Linux,because Arch Linux doesn't supports openrc,. |
i m getting below error when i run please help me... System has not been booted with systemd as init system (PID 1). Can't operate. |
Sir i m a newbie , I m getting, bash: run command not found |
@mithunpp4u |
I'm currently using batch scripts in the windows startup folder as an alternative, for example: bash <environment variables of service> <ExecStart of service> Could probably even configure it to launch as a windows service somehow to have auto restart and stopping working correctly |
I wasn't mentioning an issue @yuk7 , was merely offering a temporary workaround until the problem is fixed. |
I couldn't get working OpenRC so I used Supervisor which is working great for automatically starting my services and managing it. |
I don't seem to be able to start cronie or crontab with supervisor, how would you add it to supervisor and start it @unixfox ? |
Replacing /init is safe? |
For anyone, still interested runit is pretty good. I even use it in my real arch linux machine. All you need to do is download runit-systemd. The services can be written with simple shell scripts that can run super fast if you use link dash to sh in arch. It's amazing. |
safe but not working at all---wsl will still use Microsoft's init |
What about WSL2? I heard that there can be ported systemd by using fake namespacing or so? |
You can work around the issues with just do the following (assumes
|
It's possible to bypass that in a hacky way using genie |
I created systemctl alternative package and documented it. This is a common problem with container Linux and WSL. |
Thanks, i can confirm this script is working, i have my systemctl now :) |
I don't get it. If you use the Ubuntu image from the Microsoft Store, it ships with Systemd. No idea why it does not work with this Arch distro! |
The document link in comment #20 (comment) is broken. From some looking around this might be the next/newest info: |
That worked for me! Thanks! |
You need to install $ sudo pacman -Syuu
$ sudo pacman -S python2
$ sudo mv /usr/bin/systemctl /usr/bin/systemctl.old
$ sudo curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py -o /usr/bin/systemctl
$ sudo chown root /usr/bin/systemctl
$ sudo chgrp root /usr/bin/systemctl
$ sudo chmod +x /usr/bin/systemctl |
|
I'm trying to start nginx service like this:
but i get the following error:
System has not been booted with systemd as init system (PID 1). Can't operate.
I know that WSL currently uses a proprietary init process, but I don't know how to use it to start/restart/stop services.
It's also interesting to note that with Ubuntu WSL the command
service nginx start
works fine. Is it possible to do the same thing with Arch WSL ?The text was updated successfully, but these errors were encountered: