@@ -, +, @@ --- conf.d/Makefile | 2 +- conf.d/killprocs | 4 ++++ init.d/killprocs.in | 12 ++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 conf.d/killprocs --- a/conf.d/Makefile +++ a/conf.d/Makefile @@ -1,5 +1,5 @@ DIR= ${CONFDIR} -CONF= bootmisc fsck hostname localmount network staticroute urandom +CONF= bootmisc fsck hostname killprocs localmount network staticroute urandom TARGETS+= network staticroute CLEANFILES+= network staticroute --- a/conf.d/killprocs +++ a/conf.d/killprocs @@ -0,0 +1,4 @@ +# This variable contains a space-delimited list of PIDs which will +# not be killed by the killprocs initscript + +# DONTKILL_PIDS="42 566" --- a/init.d/killprocs.in +++ a/init.d/killprocs.in @@ -12,11 +12,19 @@ depend() start() { ebegin "Terminating remaining processes" - killall5 -15 + local dontkill + if [ -n "${DONTKILL_PIDS}" ]; then + for pid in ${DONTKILL_PIDS}; do + dontkill=${dontkill},$pid + done + dontkill=${dontkill#,} + [ -n "${dontkill}" ] && dontkill="-o ${dontkill}" + fi + killall5 -15 ${dontkill} sleep 1 eend 0 ebegin "Killing remaining processes" - killall5 -9 + killall5 -9 ${dontkill} sleep 1 eend 0 } --