[arch-general] How to reboot remotely without hanging ssh session?
lisaev at umail.iu.edu
Wed Feb 5 14:44:20 EST 2014
On Wed, 05 Feb 2014 13:19:56 -0600
"David C. Rankin" <drankinatty at suddenlinkmail.com> wrote:
> 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?
AFAIU, this issue is related to the lack of ordering
between systemd-user-sessions.service and network.target (the former should
start after the latter)... OTOH, one can simply
$ ssh root at remote.host.org
# ( sleep 30 && systemctl reboot ) &
GnuPG key: 0x164B5A6D
Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 490 bytes
Desc: not available
More information about the arch-general