mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
up
This commit is contained in:
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
# chkconfig: 2345 55 25
|
||||
# description: rsyncd Service
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rsyncd
|
||||
# Required-Start: $all
|
||||
# Required-Stop: $all
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: starts rsyncd
|
||||
# Description: starts the MDW-Web
|
||||
### END INIT INFO
|
||||
|
||||
ROOT_PATH={$SERVER_PATH}
|
||||
|
||||
p_start(){
|
||||
echo "Starting ..."
|
||||
cd $ROOT_PATH/rsyncd/init.d
|
||||
/usr/bin/rsync --daemon
|
||||
echo "rsyncd started"
|
||||
}
|
||||
|
||||
p_stop(){
|
||||
echo "Stopping ..."
|
||||
ps -ef | grep rsync | grep -v grep | grep -v python | awk '{print $2}' | xargs kill -9
|
||||
echo "rsyncd stopped"
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
p_start
|
||||
;;
|
||||
stop)
|
||||
p_stop
|
||||
;;
|
||||
restart|reload)
|
||||
p_stop
|
||||
sleep 0.3
|
||||
p_start
|
||||
;;
|
||||
*)
|
||||
echo "Please use start or stop as first argument"
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user