microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.29k stars 814 forks source link

After running `sudo systemctl poweroff` , systemd no longer boot services #8884

Closed alphagocc closed 2 years ago

alphagocc commented 2 years ago

Version

10.0.22622.601

WSL Version

Kernel Version

5.15.62.1

Distro Version

openSUSE-Tumbleweed

Other Software

No response

Repro Steps

  1. sudo systemctl poweroff
  2. Boot wsl again

Expected Behavior

run ps -ef show at least below

root         1     0  1 21:02 ?        00:00:00 /lib/systemd/systemd --unit=graphical.target
root         2     1  0 21:02 ?        00:00:00 /init
root        30     1  0 21:02 ?        00:00:00 /usr/lib/systemd/systemd-journald
root        37     1  0 21:02 ?        00:00:00 /usr/lib/systemd/systemd-udevd
message+    84     1  0 21:02 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --
root        86     1  0 21:02 ?        00:00:00 /usr/lib/systemd/systemd-logind
root       110     1  0 21:02 ?        00:00:00 /usr/libexec/wicked/bin/wickedd-auto4 --systemd --foreground
root       113     1  0 21:02 ?        00:00:00 /usr/libexec/wicked/bin/wickedd-dhcp4 --systemd --foreground
root       116     1  0 21:02 ?        00:00:00 /usr/libexec/wicked/bin/wickedd-dhcp6 --systemd --foreground
root       141     1  0 21:02 ?        00:00:00 /usr/sbin/wickedd --systemd --foreground
root       147     1  0 21:02 ?        00:00:00 /usr/sbin/wickedd-nanny --systemd --foreground
root       399     1  0 21:02 pts/0    00:00:00 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600
root       400     1  0 21:02 tty1     00:00:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root       420     2  0 21:02 ?        00:00:00 /init
root       422   420  0 21:02 ?        00:00:00 /init

Actual Behavior

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 21:02 ?        00:00:00 /usr/lib/systemd/systemd-shutdown poweroff --timeout 90000000us --log-le
root         2     1  0 21:02 ?        00:00:00 /init
root       588     2  0 21:04 ?        00:00:00 /init
root       589   588  0 21:04 ?        00:00:00 /init

Diagnostic Logs

No response

cerebrate commented 2 years ago

That looks like you didn't allow enough time for the WSL instance to actually exit before trying to start it again; systemd-shutdown is still trying to stop the last one. Does it still happen if you check that wsl -l -v shows the distro as Stopped before you try to start it again?

alphagocc commented 2 years ago

No longer Happen. Thank you. But I think it takes too long to shutdown 😄