webbuild-functions: fix killtree function to avoid killing http server

This commit is contained in:
Silvan Calarco 2014-02-01 14:57:30 +01:00
parent d73319d4ea
commit 9ab269e0f7

View File

@ -176,7 +176,8 @@ function kill_tree() {
[ $1 ] || return
kill `pstree -p $killpid | sed 's/(/\n(/g' | grep '(' | sed 's/(\(.*\)).*/\1/' | tr "\n" " "`
# tail here is used to avoid killing first pid, typically sh, which causes apache to stop since some time
kill `pstree -pl $killpid | sed 's/(/\n(/g' | grep '(' | sed 's/(\(.*\)).*/\1/' | tail -n+2 | tr "\n" " "`
return $?
}