Sergey Korzhevsky wrote:

>22.05.2002 15:37:08 "Gustavson, John (ECSS)"  wrote:
>
>
>
>>We are running SUSE 2.4.7 kernel.  We have had problems with the start-up
>>scripts in /etc/init.d(rc.d)/rc3.d for Apache, TOMCAT, and ucd-snmpd.  We
>>
>>
>put
>
>
>>several echo's of return codes in the scripts,
>>which all return 0, and it looks like the scripts are running fine, but
>>
>>
>the
>
>
>>processes do not continue.  We did use the no-hup for ucd-snmpd, but we do
>>
>>
>not
>
>
>>want to have to nohup every thing.  Apache
>>start-up problem does seem to be somewhat intermittent.  After we are
>>
>>
>fully up,
>
>
>>these same scripts can be run manually with out a problem.  It appears to
>>
>>
>be
>
>
>>only related to system boot/re-boot.  Does
>>anyone else have these problems at start-up?
>>
>>
I encountered this problem with my scripts also.  The way to solve this
prob, is to use nohup.  The problem is caused due to the "father" script
that runs all its "children" under /etc/rc?.d.  When the father script
finishes, it sends a SIGHUP to all its children.  If a child is not
properly configured to fork itself to the background (daemon), it will
exit with the SIGHUP.
The way to work around this, is to trap this signal.  You don't have to
use the /usr/bin/nohup binary (I don't like it either).  You can add
this line at the begining of your startup script (assuming /bin/bash):
trap "" SIGHUP
Enjoy.

--
Yuval Turgeman
Research Engineer, Aduva LTD.
Office +972-3-7534373, Mobile +972-54-308076

Reply via email to