Bug 123906 - syslogd race - parent is killed by SIGTERM from its child before SIGTERM signal handler is armed
syslogd race - parent is killed by SIGTERM from its child before SIGTERM sign...
Status: CLOSED DUPLICATE of bug 126223
Product: Fedora
Classification: Fedora
Component: sysklogd (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
Depends On:
  Show dependency treegraph
Reported: 2004-05-21 11:56 EDT by Pavel Tsekov
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 14:03:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace of syslogd being killed (1.81 KB, text/plain)
2004-05-21 12:00 EDT, Pavel Tsekov
no flags Details

  None (edit)
Description Pavel Tsekov 2004-05-21 11:56:26 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2)


Description of problem:
[root@linux-laptop root]# syslogd -m 0
[root@linux-laptop root]# echo $?

[root@linux-laptop root]# service syslog start
Starting system logger:                                    [FAILED]
Starting kernel logger:                                    [  OK  ]

On my machine most of the time issuing the commands above
results in preliminary death of syslogd. I've checked 
the source RPM and it seems to me that the line the following
snippet allow for a race resulting in the behaviour above:

                if (!check_pid(PidFile))
                        if (fork()) {
                                 * Parent process
                                signal (SIGTERM, doexit);

I think it is too late to arm the singal handler at 
that point - it should be done earlier.

This is not a showstopper bug, but it think its
worth fixing. At least "service" wont say that
syslogd failed when it actually succeeded.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Try to start "syslogd -m 0" from the command line
   until it is terminated by a SIGTERM signal. Maybe
   one needs to try harder on some machines.

Actual Results:  syslogd parent is killed by SIGTERM.

Expected Results:  syslogd parent should catch the signal and exit

Additional info:
Comment 1 Pavel Tsekov 2004-05-21 12:00:46 EDT
Created attachment 100422 [details]
strace of syslogd being killed
Comment 2 Aidan Evans 2004-07-28 09:50:45 EDT
  I can make this failure occur almost always by changing the
syslogd.conf line

*.info;mail.none;authpriv.none;cron.none  /var/log/messages


*.info;mail.none;authpriv.none;cron.none  -/var/log/messages

that is, by selecting asynchronous logging.
Comment 3 Jason Vas Dias 2004-08-04 10:21:52 EDT
This is now fixed in sysklogd-1.41-22 .

*** This bug has been marked as a duplicate of 126223 ***
Comment 4 Pavel Tsekov 2004-08-05 07:37:48 EDT
Shouldn't it be the other way around - this bug report was entered
first. Anyway glad to here that it's closed now.
Comment 5 Red Hat Bugzilla 2006-02-21 14:03:25 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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