(sorry for not searching and creating a "p1/critical" bug, if this is a duplicate) --- /lib/rcscripts/sh/._cfg0000_rc-daemon.sh 2006-01-20 03:27:34.000000000 +0100 +++ /tmp/._cfg0000_rc-daemon.sh 2006-01-19 18:54:47.000000000 +0100 @@ -145,7 +145,7 @@ pkill "-${signal}" -s "${pid}" pgrep -s "${pid}" >/dev/null || return 0 else - local pids="$(ps -eo pid,sid | sed -n 's/'${pid}'$//p')" + local pids="$(ps -eo pid,sid | sed -n 's/[[:space:]]'${pid}'$//p')" [[ -z ${pids} ]] && return 0 kill -s "${signal}" ${pids} 2>/dev/null e=false Explanation: imagine "Your" pid is 2345, and some process/session-id list like 1 0 2345 1 22334 12345 31567 2345 31568 2345 31569 2345 As '12345'(\NL) is matched by '2345$', sed would cut out the "2345" and then output the remainder of the 3rd line as "22334 1" which would lead to a) a "foreign" worker-pid being killed and, much worse, b) init being killed. Result would be sth. like "panic - attempt to kill init"... Regards, Dominik
btw, I'd prefer to write that sed-command which includes a variable expansion as local pids="$( ps -eo pid,sid | sed -n "s/[[:space:]]${pid}\$//p" )"
line 300 should be changed as well: - npids="${npids} $(ps -eo pid,ppid | sed -n 's/'"${pid}"'$//p')" + npids="${npids} $( ps -eo pid,ppid | sed -n "s/[[:space:]]${pid}\$//p" )"
Thanks for the patch! Fixed in baselayout-1.12.0_pre15