Bug 123906 - syslogd race - parent is killed by SIGTERM from its child before SIGTERM signal handler is armed
Summary: syslogd race - parent is killed by SIGTERM from its child before SIGTERM sign...
Keywords:
Status: CLOSED DUPLICATE of bug 126223
Alias: None
Product: Fedora
Classification: Fedora
Component: sysklogd
Version: rawhide
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-21 15:56 UTC by Pavel Tsekov
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-21 19:03:25 UTC
Type: ---
Embargoed:


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

Description Pavel Tsekov 2004-05-21 15:56:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2)
Gecko/20040308

sysklogd-1.4.1-15

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

[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);
                                sleep(300);

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):
sysklogd-1.4.1-15

How reproducible:
Sometimes

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

Additional info:

Comment 1 Pavel Tsekov 2004-05-21 16:00:46 UTC
Created attachment 100422 [details]
strace of syslogd being killed

Comment 2 Aidan Evans 2004-07-28 13:50:45 UTC
  I can make this failure occur almost always by changing the
syslogd.conf line

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

to

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

that is, by selecting asynchronous logging.

Comment 3 Jason Vas Dias 2004-08-04 14:21:52 UTC
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 11:37:48 UTC
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 19:03:25 UTC
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.