#!/bin/bash
# Begin $rc_base/init.d/sendsignals - Sendsignals Script

# Based on sendsignals script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

echo "Sending all processes the TERM signal..."
killall5 -15
error_value=$?

#
# Sleep for a while to allow processes to receive and process the TERM
# signal. The heavier your system is loaded, the higher it should sleep
# here.
#

sleep 3

if [ "$error_value" = 0 ]
then
	print_status success
else
	print_status failure
fi

echo "Sending all processes the KILL signal..."
killall5 -9
error_value=$?

#
# Increase sleep amount on heavier loaded systems.
#

sleep 3

if [ "$error_value" = 0 ]
then
	print_status success
else
	print_status failure
fi


# End $rc_base/init.d/sendsignals

