summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2008-04-11 04:35:52 +0000
committerGuillem Jover <guillem@hadrons.org>2010-06-10 23:21:22 +0200
commitc57976b73376c621c31d64110860ed0c29116a68 (patch)
treebb9bc0ad78ab0b11f5320244b0b59f58bbac73ce
parent6ddf988f44cd30be0cea66e1712a3b2103e4fc88 (diff)
downloadinetutils-c57976b73376c621c31d64110860ed0c29116a68.tar.gz
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.
-rw-r--r--debian/changelog3
-rw-r--r--debian/patches/52_sigalarm.patch42
-rw-r--r--debian/patches/series1
3 files changed, 46 insertions, 0 deletions
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 <guillem@debian.org> 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