[arch-projects] [RFC] [PATCH] [initscripts] Add killall5 omit pid functionality.
(me) Update the offsets so can be merged now without any issues and respect the indentation. Implements FS#10536 - [initscripts] internal: save a pid from killall5 All credits to: Kurt J. Bosch Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- functions | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/functions b/functions index fd0928e..6d279cc 100644 --- a/functions +++ b/functions @@ -222,6 +222,14 @@ ck_status() { fi } +# PIDs to be omitted by killall5 +declare -a omit_pids + +add_omit_pids() { + omit_pids+=( $@ ) +} + + kill_everything() { # $1 = where we are being called from. # This is used to determine which hooks to run. @@ -241,12 +249,16 @@ kill_everything() { # Terminate all processes stat_busy "Sending SIGTERM To Processes" run_hook "$1_prekillall" - /sbin/killall5 -15 &> /dev/null + local pid k5args="" + for pid in ${omit_pids[@]}; do + k5args+=" -o $pid" + done + /sbin/killall5 -15 $k5args &> /dev/null /bin/sleep 5 stat_done stat_busy "Sending SIGKILL To Processes" - /sbin/killall5 -9 &> /dev/null + /sbin/killall5 -9 $k5args &> /dev/null /bin/sleep 1 stat_done -- 1.7.5.1
Am 17.05.2011 04:22, schrieb Gerardo Exequiel Pozzi:
(me) Update the offsets so can be merged now without any issues and respect the indentation.
Implements FS#10536 - [initscripts] internal: save a pid from killall5
All credits to: Kurt J. Bosch
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
When this bug was originally supported, it required patching sysvinit. It seems this has been merged into upstream sysvinit and nobody told me. +1.
On Tue, May 17, 2011 at 4:22 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
(me) Update the offsets so can be merged now without any issues and respect the indentation.
Implements FS#10536 - [initscripts] internal: save a pid from killall5
All credits to: Kurt J. Bosch
Cool, cool, cool! Will test and push :-) Cheers! -t
On 05/17/2011 07:06 AM, Tom Gundersen wrote:
On Tue, May 17, 2011 at 4:22 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
(me) Update the offsets so can be merged now without any issues and respect the indentation.
Implements FS#10536 - [initscripts] internal: save a pid from killall5
All credits to: Kurt J. Bosch Cool, cool, cool! Will test and push :-)
As I said in the FS I personally test this with archiso with my unionfs-fuse patch to avoid killing the daemon at shutdown/single/reboot.
Cheers!
-t
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Gerardo Exequiel Pozzi
-
Thomas Bächler
-
Tom Gundersen