On 05/10/2018 16.29, Roger Oberholtzer wrote:
On Fri, Oct 5, 2018 at 4:19 PM Per Jessen
wrote: Roger Oberholtzer wrote:
On a local network, what would be the preferred way for one system to shut down or reboot another system? Something over the network.
ssh target 'shutdown' or 'reboot' ?
That's what I would think. I am just curious if I am missing some detail.
I think this will be in a systemd service that mimics whatever the user is doing locally. A local reboot does a remote boot. A local shutdown does a remote shutdown.
Or something like that.
You just run "poweroff" as root in the ssh session as root (or user, then su). However, if there is a graphical session in that computer, with someone there, his session will die suddenly, no data saved at all. Same if there are remote users. I remember that some commands give a message to everybody that poweroff is coming in 5 minutes. But I do not see it in "man halt" or "man poweroff". Maybe "shutdown". shutdown [OPTIONS...] [TIME] [WALL...] I'm unsure of "systemctl" command to do the same and properly. Maybe switch to level 0. But I do not trust it, in my machine switch to level 3 hangs. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas))