initscripts/etc/rc.d/init.d/sendsignals

34 lines
821 B
Bash
Executable File

#!/bin/sh
# sendsignals - Sendsignals Script
#
# Based on sendsignals script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans <gerard@linuxfromscratch.org>
# Support for 2.6.x kernels by Davide Madrisan <davide.madrisan@gmail.com>
# Also modified by Silvan Calarco <silvan.calarco@mambasoft.it>
. /etc/sysconfig/rc
. $rc_functions
case "${1}" in
stop)
echo -n "Sending all processes the TERM signal..."
killall5 -15
error_value=$?
[ "$error_value" = 0 ] && echo_success || echo_failure
echo
sleep 2
echo -n "Sending all processes the KILL signal: "
killall5 -9
error_value=$?
[ "$error_value" = 0 ] && echo_success || echo_failure
echo
sleep 2
;;
*)
echo "Usage: ${0} {stop}"
exit 1
;;
esac