Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
mdserver-web/plugins/simdht/init.d/simdht.tpl

44 lines
829 B

#!/bin/sh
# chkconfig: 2345 55 25
# description: DHTSpider Service
### BEGIN INIT INFO
# Provides: DHTSpider
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts DHTSpider
# Description: starts the MDW-Web
### END INIT INFO
dht_start(){
cd {$SERVER_PATH}/simdht/workers
nohup python simdht_worker.py > {$SERVER_PATH}/simdht/logs.pl 2>&1 &
echo "simdht started"
}
dht_stop(){
echo "Stopping ..."
ps -ef | grep "python simdht" | grep -v grep | awk '{print $2}' | xargs kill
echo "simdht stopped"
}
case "$1" in
start)
dht_start
;;
stop)
dht_stop
;;
restart|reload)
dht_stop
sleep 0.3
dht_start
;;
*)
echo "Please use start or stop as first argument"
;;
esac