diff options
author | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
commit | df88860947686a5e6507fc5d60ff33eac1158c6b (patch) | |
tree | d1dc7f2f003b08afb6d45f7170d7a0dd353060d3 /xi/init.d/sendsignals | |
parent | 33d239ecb3d66db2b005afbe68a7029c3f2d2ee0 (diff) |
Diffstat (limited to 'xi/init.d/sendsignals')
-rw-r--r-- | xi/init.d/sendsignals | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/xi/init.d/sendsignals b/xi/init.d/sendsignals new file mode 100644 index 0000000..d2c80eb --- /dev/null +++ b/xi/init.d/sendsignals @@ -0,0 +1,69 @@ +#!/bin/sh +######################################################################## +# Begin sendsignals +# +# Description : Sendsignals Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: sendsignals +# Required-Start: +# Should-Start: +# Required-Stop: $local_fs swap localnet +# Should-Stop: +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Attempts to kill remaining processes. +# Description: Attempts to kill remaining processes. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + stop) + omit=$(pidof mdmon) + [ -n "$omit" ] && omit="-o $omit" + + log_info_msg "Sending all processes the TERM signal..." + killall5 -15 $omit + error_value=${?} + + sleep ${KILLDELAY} + + if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then + log_success_msg + else + log_failure_msg + fi + + log_info_msg "Sending all processes the KILL signal..." + killall5 -9 $omit + error_value=${?} + + sleep ${KILLDELAY} + + if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then + log_success_msg + else + log_failure_msg + fi + ;; + + *) + echo "Usage: ${0} {stop}" + exit 1 + ;; + +esac + +exit 0 + +# End sendsignals |