The Computer Oracle

unable to shutdown / reboot my Debian 10 server

-------------------------------------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Light Drops

--

Chapters
00:00 Question
00:37 Accepted answer (Score 40)
00:57 Answer 2 (Score 55)
01:40 Answer 3 (Score 10)
01:55 Answer 4 (Score 5)
02:17 Thank you

--

Full question
https://superuser.com/questions/1462581/...

Question links:
[this]: https://superuser.com/questions/513596/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #debian #terminal #shutdown #reboot

#avk47



ANSWER 1

Score 60


Debian 10 has now fully switched to Systemd which means that the traditional commands to halt or reboot a system like 'shutdown -h now' or 'reboot' will not work anymore

source

Starting with Debian 10, you should use the commands systemctl poweroff or systemctl reboot.

Edit: It appears the above source was partially incorrect, you can still log in as root (see answer by Eugene) to run the old commands. If you don't want to log in as root, use systemctl.

source




ACCEPTED ANSWER

Score 46


The trick on how to fix this inconvenience is to explicitly tell the su to set environment variable as if the user logs in directly. This is can be done by the use of - switch.

$ su -



ANSWER 3

Score 10


As root -> systemctl poweroff or systemctl reboot.




ANSWER 4

Score 0


Try:

nano /bin/reboot

add line: systemctl reboot

exit and save

chmod to your preffered execution level.

I'm sure there is a more elegant way to fix this but I am going to have a hard time remembering that only debian 10 requires a special reboot command. This works for me as long as I'm in su first.