On 05.02.2014 20:19, David C. Rankin wrote: > Guys, > > I remote administer one arch server and after moving to systemd I > haven't found a way to reboot without hanging the ssh session. Prior to > system, we could simply pass the shutdown command via ssh and the ssh > session would complete/close before reboot took place: i.e. > > $ ssh remote.host.org "sudo shutdown -r now" > > However with systemd, using "systemctl reboot" the ssh session hangs > until the remote host reboot or a timeout occurs. > > Is there a better way to reboot a remote server and avoid this? > I'm using the following line: $ su -c "systemctl --no-block reboot" && exit I enter my password, then I instantly see the broadcast message telling me that the system is going down and the ssh session gets closed. If you started the session as root, this line should do: # systemctl --no-block reboot && exit I didn't try it, because root login is disabled on my machines. Regards, Robert. -- GnuPG-Key: EDC67BBA Fingerprint: D5F0 BC03 3F6D 521C 6F2D 40C8 DDBA 25D9 EDC6 7BBA
Attachment:
signature.asc
Description: OpenPGP digital signature