Description of problem: Some programs (HAProxy for example when running with nprocs=2) write multiple pids to the same pidfile, each on its own line. Killproc only reads the first line of a pid file, so it will only kill the first process found.
Hm, this would be a behavior change - this may have unintended consequences. diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index acef332..bb58048 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -152,10 +152,15 @@ __pids_var_run() { pid= if [ -f "$pid_file" ] ; then local line p - read line < "$pid_file" - for p in $line ; do - [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p" - done + + while : ; do + read line + [ -z "$line" ] && break + for p in $line ; do + [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p" + done + done < "$pid_file" + if [ -n "$pid" ]; then return 0 fi Does this fix it for you?
Created attachment 325267 [details] patch, avoiding bugzilla pasting fun
This fixes it for me, thanks. I'm not sure what other programs will break though...
http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=d8d067e3e2c6492fa16d6290e7b5fbb9a9e0b745 Will be in rawhide with the next build. Due to the behavior change, it's very unlikely to be backported to a release.