Bug 64603 - initlog bug: child sometimes missed and incorrect return code
Summary: initlog bug: child sometimes missed and incorrect return code
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 7.2
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
: 71124 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2002-05-08 15:27 UTC by diego.santacruz
Modified: 2014-03-17 02:27 UTC (History)
3 users (show)

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

Attachments (Terms of Use)

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:

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
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.

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