scripts modified with -fstack-protect option, and micasad was updated to support try-restart and status commands.

This commit is contained in:
Cameron (Kamran) Mashayekhi
2006-02-13 16:52:25 +00:00
parent ec458809d0
commit 4c374e507d
13 changed files with 84 additions and 25 deletions

View File

@@ -30,34 +30,66 @@ rc_reset
case "$1" in
start)
echo -n "Starting miCASA daemon"
echo "Starting miCASA daemon"
startproc -f $MICASAD_BIN
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting miCASA daemon down"
echo "Shutting miCASA daemon down"
#killproc -TERM $MICASAD_BIN
pid=`cat /var/run/micasad.pid`
kill -s TERM $pid
pid=`cat /var/run/micasad.pid` > /dev/null 2>&1
kill -s TERM $pid > /dev/null 2>&1
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
# $0 status >/dev/null && $0 restart
$0 restart
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
echo -n "Restarting miCASA daemon"
echo "Restarting miCASA daemon"
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
status)
echo "Checking for service micasad ..."
checkproc micasad
if [ $? == 0 ]
then
echo -n "0 - service up and running"
elif [ $? == 1 ]
then
echo -n "1 - service dead, but /var/run/pid file exists"
elif [ $? == 2 ]
then
echo -n "2 - service dead, but /var/lock/lock file exists"
elif [ $? == 3 ]
then
echo -n "3 - service not running (unused)"
elif [ $? == 4 ]
then
echo -n "4 - service status unknown"
else
echo -n "5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)"
fi
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart}"
echo "Usage: $0 {start|stop|restart|try-restart|status}"
exit 1
;;
esac