* Re-wrote/cleaned up init scripts * Re-wrote init-functions * Moved some things (init scripts, defaults, configs) to other packages * Added update-rc which manages /etc/rc* directories * Added usher to manage defaults
46 lines
860 B
Bash
Executable File
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
|