updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / taobao-tair-svn / config_server.rc
blobc5e1eef4c0d3fa9f09fa4254e533c88048f5954d
1 #!/bin/bash
3 # sourcing our current rc.conf requires this to be a bash script
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 #rc=0
8 tair_root=/usr/local/tair
9 cd $tair_root
11 PID=`cat $tair_root/logs/config.pid`
13 case "$1" in
14 start)
15 stat_busy "Tair config server"
16 $tair_root/sbin/tair_cfg_svr -f $tair_root/etc/configserver.conf
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 stat_done
23 stop)
24 stat_busy "Stopping Tair config server"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac
40 exit 0
42 # vim: set ts=2 noet: