openrc/src/rc
Thomas Pfaff 062223a5df Avoid race condition in runscript (bug #319865)
Under normal conditions, runscript creates one child and waits for its
termination, which is signaled by a pipe write from the SIGCHLD
sighandler.

When running killprocs however more than one SIGHCLD signal is generated, at
least on all of my amd64 boxes running on real hardware and in vmware.

When the first SIGCHLD occurs svc_exec leaves the loop and closes the pipe.
Subsequent SIGCHLDs during the close can lead to a race condition and create an
EBADF error in the pipe write (pipe is closed but the file handle is still !=
-1).

We avoid this by blocking SIGHCHLD during the pipe close.
2010-12-03 14:01:28 -06:00
..
_usage.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
_usage.h Add (c) to Copyright 2009-05-01 15:11:40 +01:00
.gitignore Add new utility and init script swclock that sets the system time based on 2009-10-13 08:03:45 +01:00
builtins.h Add new utility and init script swclock that sets the system time based on 2009-10-13 08:03:45 +01:00
checkpath.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
fstabinfo.c random spelling fixes 2010-01-08 22:02:51 +00:00
Makefile Regenerate version.h if necessary 2009-10-16 08:13:34 +01:00
mountinfo.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-applets.c random spelling fixes 2010-01-08 22:02:51 +00:00
rc-depend.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-logger.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-logger.h Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-misc.c Move non compiled libraries from /lib/rc to /libexec/rc 2009-05-23 20:38:12 +01:00
rc-plugin.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-plugin.h Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-service.c Add (c) to Copyright 2009-05-01 15:11:40 +01:00
rc-status.c Add runlevel stacking, #88 2009-05-02 12:26:45 +01:00
rc-update.c Fix two leaks. 2010-03-17 20:37:47 +00:00
rc.c Fix -s and -S. 2010-03-26 22:10:03 +00:00
runscript.c Avoid race condition in runscript (bug #319865) 2010-12-03 14:01:28 -06:00
start-stop-daemon.c start-stop-daemon can now set process IO scheduling. 2009-12-14 08:47:48 +00:00
start-stop-daemon.pam Allow non root users to use start-stop-daemon when linked with pam, Gentoo bug #207836. 2008-02-03 23:02:02 +00:00
swclock.c Fix logic 2009-11-13 22:29:01 +00:00