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

Re: OT: How to recursively call a script?



On Sun, 13 Jul 2003 18:05:03 -0600
westk@acu.edu wrote:

> OT: How to recursively call a script?
> 
> 
> 
> 
> I've got a Solaris box, and I need to remotely restart the 
> ssh daemon. On Debian, most init scripts have a "restart" 
> option. Solaris apparently doesn't (what's with that?!).
> 
> The script looks roughly like this:
> 
> #!/bin/sh
> 
> case $1 in
> 'start')
> Ê /usr/local/sbin/sshd
> Ê ;;
> 'stop')
> Ê {code to stop the PID of sshd}
> Ê ;;
> esac
> 
> I'd like to add a stanza like:
> 
> 'restart')
> Ê /etc/init.d/sshd stop
> Ê /etc/init.d/sshd start
>  ;;
> 

why not just do:
'restart')
Ê {code to stop the PID of sshd}
Ê /usr/local/sbin/sshd
Ê ;;



> Secondly, assuming the script is made to work, will it work 
> remotely, or will the process be killed when the sshd 
> daemon goes down because it's a process spawned from 
> an incoming ssh connection that's a "sub-process" of that 
> sshd daemon?

It will not kill the sshd child processes.  You can safely perform this action remotely.


good luck,
chris



Reply to: