Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 64603

Summary: initlog bug: child sometimes missed and incorrect return code
Product: [Retired] Red Hat Linux Reporter: diego.santacruz
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: gajownik, klages, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-31 21:04:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description diego.santacruz 2002-05-08 15:27:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020326

Description of problem:
When running some initscripts (/etc/init.d/*) from /sbin/ifup-local, initlog
fails on childs that fork. Even though the child starts succesfully, initlog
exits with a code of 255. This happens exclusively if the ifup network scripts
are run from the hotplug agent (e.g., as the result of inserting an ethernet
pcmcia card).

This happens because the waitpid call (in the monitor function of process.c)
fails with ECHILD. For some reason the pid given to waitpid has dissapeared,
without even leaving a zombie process waiting for the waitpid call. Maybe
SIGCHLD is being ignored?

I have experienced this with calls to 'service nscd condrestart' in
/sbin/ifup-local. It also happens with smb.
The main problem is that the /var/lock/subsys/nscd file is not created, even
though the system restarted, and thus subsequent calls to "service nscd
condrestart" will just do nothing.


Version-Release number of selected component (if applicable):
initscripts-6.43-1, kernel-2.4.18-3, hotplug-2001_04_24-11


How reproducible:
Always

Steps to Reproduce:
1. insert a call to 'service nscd condrestart' in /sbin/ifup-local
2. start nscd service: "service nscd start"
3. insert ethernet pcmcia card.
4. "nscd: nscd startup failed" appears in /var/log/messages and the file
/var/lock/subsys/nscd does not exist. However the nscd service has been
restarted. This is due to initlog reporting exit code 255, even though the child
started.
5. eject ethernet pcmcia card
6. insert ethernet pcmcia card back again
7. the nscd service is not restarted, because /etc/init.d/nscd thinks the
service is not running.
	
This is extermely annoying with laptops, since suspending the machine and then
plugging into another network does not correctly restart the necessary services.

Additional info:

Comment 1 diego.santacruz 2002-06-21 12:17:17 UTC
I did a bit more of research and I've found the problem and a workaround.
The culprit is the kernel or hotplug (one of the two should enable SIGCHLD).
I have reported this as bug #67232 against hotplug, with a wrapper the
re-enables SIGCHLD.

Comment 2 diego.santacruz 2002-10-10 15:41:01 UTC
OK, as explained by alan in bug #67232, if initlog is to rely on wait() and or
waitpid(), it should set SIGCHLD to SIG_DFL. So it's initlog which should be fixed.

I tested on a freshly installed RedHat 8.0 (initscripts-6.95-1) and initlog is
still broken.

Comment 3 Bill Nottingham 2003-06-06 22:40:17 UTC
*** Bug 71124 has been marked as a duplicate of this bug. ***

Comment 4 Bill Nottingham 2005-03-31 21:04:16 UTC
At this point, initlog is officially deprecated in the development tree; I doubt
this error will be addressed.