#!/bin/bash
#jiayun
# chkconfig: 2345 55 25
# description: This service starts up the Smokepingserver daemon.
. /etc/init.d/functions
# Start the service Smokeping
start() {
echo -n "Starting Smokeping: "
/usr/local/smokeping/bin/smokeping--logfile=/var/log/smokeping.log >/dev/null 2>&1
### Create the lock file ###
touch /var/lock/subsys/smokeping
success $"Smokeping startup"
echo
}
# Restart the service Smokeping
stop() {
echo -n "Stopping Smokeping: "
kill -9 `ps ax | grep"/usr/local/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1}'` >/dev/null 2>&1
### Now, delete the lock file ###
rm -f /var/lock/subsys/smokeping
success $"Smokeping shutdown"
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
chk_conf)
/usr/local/smokeping/bin/smokeping --check
;;
version)
/usr/local/smokeping/bin/smokeping --version
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0{start|stop|version|chk_conf|reload|status}"
exit 1
esac
exit 0