SOURCES: sysklogd-sighandler.patch (NEW) - fork bug resolved, fina...

glen glen at pld-linux.org
Mon Mar 27 21:49:48 CEST 2006


Author: glen                         Date: Mon Mar 27 19:49:48 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fork bug resolved, finally. thx agaran for helping to think ;)

---- Files affected:
SOURCES:
   sysklogd-sighandler.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/sysklogd-sighandler.patch
diff -u /dev/null SOURCES/sysklogd-sighandler.patch:1.1
--- /dev/null	Mon Mar 27 21:49:48 2006
+++ SOURCES/sysklogd-sighandler.patch	Mon Mar 27 21:49:43 2006
@@ -0,0 +1,21 @@
+--- sysklogd-1.4.1/syslogd.c	2006-03-27 22:46:40.000000000 +0300
++++ sysklogd-1.4.1.sighandler/syslogd.c	2006-03-27 22:48:30.000000000 +0300
+@@ -904,11 +904,17 @@
+ 		dprintf("Checking pidfile.\n");
+ 		if (!check_pid(PidFile))
+ 		{
++			/*
++			 * set the handler before forking, because on very fast cpu's the
++			 * signal is delivered before the handler is installed. and then
++			 * the parent exits with non-success.
++			 */
++			signal (SIGTERM, doexit);
++
+ 			if (fork()) {
+ 				/*
+ 				 * Parent process
+ 				 */
+-				signal (SIGTERM, doexit);
+ 				sleep(300);
+ 				/*
+ 				 * Not reached unless something major went wrong.  5
================================================================


More information about the pld-cvs-commit mailing list