[CentOS] /etc/rc5.d

Thu Sep 11 12:19:18 UTC 2008
Romeo Ninov <rninov at gmail.com>

tony.chamberlain at lemko.com  wrote / napísal(a):
> I have a shell script, /usr/bin/joevpn, which does a quick VPN
> connect.  Basically (HOST and DOFIL are defined above and are correct.
> I just did not list them here)
>
>      case "$1" in
>
>      start)
>         date > $DOFIL
>         while [ -f $DOFIL ]
>         do
>                 echo y | /usr/local/bin/vpnclient connect $HOST
>                 sleep 10
>         done
>         ;;
>         # Reconnects in case of disconnect (in while loop)
> This works.  And in /etc/init.d I have a runjoevpn (which linked to
> /etc/rc5.d/S99runjoevpn).  It works like the others.  Below, $1 is checked
> (not shown here for brevity) and if it is "start" then start below is
> called:
>
>       start() {
>                 date >> /root/joe.log
>                 /usr/bin/joevpn start &
>                 RES=$?
>                 return $RES
>       }
>
> This all works and everything.  I am just curious as to why when I do
> a ps I get this:
>         /bin/bash /etc/rc5.d/S99runjoevpn
>
> Shouldn't that init script terminate since I have an "&" when I do the
> start() function above? No other rc5 stuff (i.e. tomcat for instance)
> shows up in the ps, though tomcat is running, it started up and returned.
> Is this OK or am I missing something?
>
>   
Because you start it each 10 seconds and because of while construction 
the start script NEVER end