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

45 lines
829 B

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