This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 64603 - initlog bug: child sometimes missed and incorrect return code
initlog bug: child sometimes missed and incorrect return code
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
: 71124 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-08 11:27 EDT by diego.santacruz
Modified: 2014-03-16 22:27 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-31 16:04:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description diego.santacruz 2002-05-08 11:27:31 EDT
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 08:17:17 EDT
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 11:41:01 EDT
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 18:40:17 EDT
*** Bug 71124 has been marked as a duplicate of this bug. ***
Comment 4 Bill Nottingham 2005-03-31 16:04:16 EST
At this point, initlog is officially deprecated in the development tree; I doubt
this error will be addressed.

Note You need to log in before you can comment on or make changes to this bug.