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

34 lines
821 B
Plaintext
Raw Normal View History

2011-04-26 12:26:24 +02:00
#!/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>
2011-04-26 12:26:24 +02:00
. /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
2011-04-26 12:26:24 +02:00
sleep 2
echo -n "Sending all processes the KILL signal: "
killall5 -9
error_value=$?
[ "$error_value" = 0 ] && echo_success || echo_failure
echo
2011-04-26 12:26:24 +02:00
sleep 2
;;
2011-04-26 12:26:24 +02:00
*)
echo "Usage: ${0} {stop}"
exit 1
;;
esac