Add the parent of the sysupgrade script to the list of pids not getting
killed
Signed-off-by: Mat Trudel <mat@geeky.net>
Signed-off-by: John Crispin <john@phrozen.org>
local loop="${2:-0}"
local run=true
local stat
+ local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat)
echo -n "Sending $sig to remaining processes ... "
read pid name state ppid rest < $stat
name="${name#(}"; name="${name%)}"
- # Skip PID1, ourself and our children
- [ $pid -ne 1 -a $pid -ne $$ -a $ppid -ne $$ ] || continue
+ # Skip PID1, our parent, ourself and our children
+ [ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue
local cmdline
read cmdline < /proc/$pid/cmdline