remote poweroff with systemd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello all,

In one installation I manage I have a script that (among other
actions) remotely shuts down a number of headless machines. 

Until recently these machines used the traditional init scripts,
and the commands in the script were

ssh -t remote1 "sudo /sbin/init 0"
ssh -t remote2 "sudo /sbin/init 0"

etc. This has worked well for years.

Recently the machines were upgraded and mow use systemd.
I replaced the original commands by

ssh -t remote1 "sudo telinit 0"

etc. This shuts down the first one OK, but then the script
hangs. Apparently the ssh connection isn't closed cleanly.

I didn't yet try 'systemctl poweroff', but according the
man page, 'telinit 0' is equivalent to it.

Another one I didn't yet try (just discovered it in the man
pages but I don't have access to the installation ATM) is
systemctl's --host option, in other words, let systemctl
do the ssh. Can this be expected to work ? If not, any
other ideas ?

TIA for any help or hints.


-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux