How to reboot Ubuntu Server by command? Error 'Failed to reboot: Invalid argument. System has not been booted with systemd as init system (PID 1)'
I install Ubuntu on Windows 10 via Microsoft Store! and I can't reboot it I try Google and error:
:~# sudo reboot now
Failed to write reboot parameter file: No such file or directory
:~# sudo reboot -f
Rebooting.
Failed to reboot: Invalid argument
:~# sudo reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
:~# sudo reboot -h
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
:~# sudo reboot -h now
Failed to write reboot parameter file: No such file or directory
:~# sudo shutdown -r now
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
:~# sudo shutdown -r -H +0
System has not been booted with systemd as init system (PID 1). Can't operate.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
:~# sudo systemctl reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
System has not been booted with systemd as init system (PID 1). Can't operate.
:~#How to reboot it? Thanks
I got the answer:
wslreboot
wsl --shutdown
2 Answers
I think you have already logged in as super user and you don't need sudo before your command. Anyway, please try this command and see if it works:
#/sbin/rebootOr
#/sbin/shutdown -r now 1 Try using sudo service redis-server start
Your version of WSL may not use systemd. The above command is used to restart the server.
2