The Computer Oracle

unable to shutdown / reboot my Debian 10 server

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Magic Ocean Looping

--

Chapters
00:00 Unable To Shutdown / Reboot My Debian 10 Server
00:25 Accepted Answer Score 46
00:43 Answer 2 Score 10
00:52 Answer 3 Score 60
01:24 Answer 4 Score 0
01:43 Thank you

--

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

--

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.