Files
initscripts/SRC/initscripts/init.d/sendsignals
Jay Larson 843c8721f1 The following changes were made:
* Configuration moved to new CONFIG directory to separate from usher
  * Made various improvements to most init scripts
  * Added dependency to perl for update-rc
2018-07-28 14:30:08 -05:00

46 lines
860 B
Bash
Executable File

#!/bin/sh
### BEGIN INIT INFO
# Provides: sendsignals
# Required-Start:
# Required-Stop: $local_fs swap localnet
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop: 0 6
# Short-Description: Kill remaining processes
# X-Required: true
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
stop)
log_init_msg "Sending all processes the TERM signal"
killall5 -15
for i in 1 2 3 4 5 6 7 8 9 10; do
if ! killall5 -18; then
success=1
break;
fi
done
if [ -z "$success" ]; then
log_init_msg "Sending all processes the KILL signal"
killall5 -9
if [ "$?" == 0 -o "$?" == 2 ]; then
success=1
fi
fi
[ -z "$success" ] && log_failure_msg || log_success_msg
;;
*)
echo "Usage: $0 [stop]"
exit 1
;;
esac
exit 0