docker-systemctl-replacement icon indicating copy to clipboard operation
docker-systemctl-replacement copied to clipboard

Does this work with WSL-1?

Open bayeslearnerold opened this issue 4 years ago • 2 comments

I tried to use it to load ssh server in WSL automatically. Manually starting (systemctl start ) works. I already enabled ssh service (systemctl enable).

But it does not seem load ssh autommatically when I restart WSL with lxssmanager.

What am I missing?

bayeslearnerold avatar Mar 06 '21 06:03 bayeslearnerold

I guess systemd is not really loaded as pid=1, and it seems that WSL starts with first process running in it. Is there a way to invoke systemctl to run all enabled services?

` wsl -u root systemctl isolate multi-user.target

ERROR:systemctl:Unknown operation isolate. `

bayeslearnerold avatar Mar 06 '21 07:03 bayeslearnerold

The systemctl-replacement script has been succussfully used with WSL. Please check out Pengwin as mentioned in #106

As for the usage: you can run all services with "systemctl default" and you can use the option "-1" to force the script into init-daemon mode if it was not run as PID-1 originally.

Some of the example scripts do also use "systemctl init xy.service" which is actually just "systemctl -1 start xy.service". You can use that for testing whether your services do start at all with the replacment-script - because it is not fully compatible.

Actually, you came across one part that is not fully supported - the case of handling xy.target scenarios including the "systemctl isolate" subcommand. There are some enhancements in the current "develop" branch that you may want to test. However in the real world I did not need any specific support. I think if you can solve the problem of running the script as the init-daemon then the rest of the problems will go away.

gdraheim avatar Mar 10 '21 00:03 gdraheim