Re: CentOS-6.7 Passing delayed shutdown via ssh command line argument?

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



In article <f90407e5ac62949cab27d3bda74faa74.squirrel@xxxxxxxxxxxxxxxxxxxxx>,
James B. Byrne <byrnejb@xxxxxxxxxxxxx> wrote:
> If I log into a host via ssh from my workstation then I can enter this:
> 
> shutdown -r +90&
> 
> and log out.  The shutdown command will continue in effect and will
> activae 90 minutes later.
> 
> However, if I do this instead:
> 
> ssh -t host.domain.tld 'shutdown -r +90&'
> 
> then the shutdown command does not remain in effect.  Why is this so
> and is there some way to achieve this?

I think shutdown receives a HUP signal when the connection is terminated,
because it still has the ssh tty as its controlling terminal.

I've just done some experimenting using sleep instead of shutdown, and
found this:
- you need to omit the -t
- you need to redirect stdin/stdout/stderr

So try:

ssh host.domain.tld 'shutdown -r +90 </dev/null >/dev/null 2>&1 &'

Cheers
Tony
-- 
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux