RE: /etc/rc5.d

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



tony.chamberlain@xxxxxxxxx wrote:
> 
>       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?

The "&" doesn't terminate anything.  It simply moves the process to the
background and leaves it attached to the parent process.  The parent
process cannot exit until all of its child processes exit.  What you are
looking for is this:

   start() {
             date >> /root/joe.log
             nohup /usr/bin/joevpn start &
             RES=$?
             return $RES
   }

The "nohup" command will detach the joevpn process from the parent and
allow the parent process to exit.

-- 
Bowie
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://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