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

2015-09-30 Thread Devin Reade
man nohup
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


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

2015-09-30 Thread Tony Mountifield
In article ,
James B. Byrne  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 2>&1 &'

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


[CentOS] CentOS-6.7 Passing delayed shutdown via ssh command line argument?

2015-09-30 Thread James B. Byrne
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?


-- 
***  e-Mail is NOT a SECURE channel  ***
Do NOT transmit sensitive data via e-Mail
James B. Byrnemailto:byrn...@harte-lyne.ca
Harte & Lyne Limited  http://www.harte-lyne.ca
9 Brockley Drive  vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada  L8E 3C3

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos