From c57976b73376c621c31d64110860ed0c29116a68 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 11 Apr 2008 04:35:52 +0000 Subject: Fix a race condition when setting the SIGALRM signal in syslogd parent When starting the daemon it was causing the parent to exit with a non-zero status. --- debian/changelog | 3 +++ debian/patches/52_sigalarm.patch | 42 ++++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 46 insertions(+) create mode 100644 debian/patches/52_sigalarm.patch diff --git a/debian/changelog b/debian/changelog index 8ddbb0e..418b571 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,9 @@ inetutils (2:1.5.dfsg.1-5) UNRELEASED; urgency=low (Closes: #370349, #462739) - debian/patches/51_add_load_confdir_support.patch: New file - debian/patches/50_split_load_conffile.patch: Likewise. + * Fix a race condition when setting the SIGALRM signal in syslogd parent + when starting the daemon, causing it to exit with a non-zero status. + - debian/patches/52_sigalarm.patch: New file. -- Guillem Jover Fri, 18 May 2007 07:37:19 +0300 diff --git a/debian/patches/52_sigalarm.patch b/debian/patches/52_sigalarm.patch new file mode 100644 index 0000000..848db19 --- /dev/null +++ b/debian/patches/52_sigalarm.patch @@ -0,0 +1,42 @@ +Index: b/syslogd/syslogd.c +=================================================================== +--- a/syslogd/syslogd.c 2008-04-11 06:58:34.000000000 +0300 ++++ b/syslogd/syslogd.c 2008-04-11 07:16:16.000000000 +0300 +@@ -268,6 +268,7 @@ void cfline (const char *, struct filed + const char *cvthname (struct sockaddr_in *); + int decode (const char *, CODE *); + void die (int); ++void doexit (int); + void domark (int); + void fprintlog (struct filed *, const char *, int, const char *); + static int load_conffile (const char *, struct filed **); +@@ -477,6 +478,7 @@ main (int argc, char *argv[]) + + IMO, the GNU/Linux distributors should fix there booting + sequence. But we still keep the approach. */ ++ signal (SIGTERM, doexit); + ppid = waitdaemon (0, 0, 30); + if (ppid < 0) + { +@@ -623,7 +625,7 @@ main (int argc, char *argv[]) + /* If we're doing waitdaemon(), tell the parent to exit, + we are ready to roll. */ + if (ppid) +- kill (ppid, SIGALRM); ++ kill (ppid, SIGTERM); + + for (;;) + { +@@ -1553,6 +1555,12 @@ logerror (const char *type) + } + + RETSIGTYPE ++doexit (int signo ARG_UNUSED) ++{ ++ exit (0); ++} ++ ++RETSIGTYPE + die (int signo) + { + struct filed *f; diff --git a/debian/patches/series b/debian/patches/series index aaff394..77152c6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,3 +12,4 @@ 43_ret_converted_to_int.patch -p0 50_split_load_conffile.patch 51_add_load_confdir_support.patch +52_sigalarm.patch -- cgit v1.2.3