Smokeping 服务启动代码

#!/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

 

 

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS