Ubuntu working init.d
This commit is contained in:
1 parent
786250f9f8
commit
59c1e49fee
1 file changed
+5
-5
+5
-5
@@ -16,6 +16,9 @@
|
|||||||
# path to app
|
# path to app
|
||||||
APP_PATH=/usr/local/sbin/CouchPotatoServer/
|
APP_PATH=/usr/local/sbin/CouchPotatoServer/
|
||||||
|
|
||||||
|
# user
|
||||||
|
RUN_AS=YOUR_USERNAME_HERE
|
||||||
|
|
||||||
# path to python bin
|
# path to python bin
|
||||||
DAEMON=/usr/bin/python
|
DAEMON=/usr/bin/python
|
||||||
|
|
||||||
@@ -29,9 +32,6 @@ NAME=couchpotato
|
|||||||
# app name
|
# app name
|
||||||
DESC=CouchPotato
|
DESC=CouchPotato
|
||||||
|
|
||||||
# user
|
|
||||||
RUN_AS=root
|
|
||||||
|
|
||||||
# startup args
|
# startup args
|
||||||
DAEMON_OPTS=" CouchPotato.py --daemon --pid_file=${PID_FILE}"
|
DAEMON_OPTS=" CouchPotato.py --daemon --pid_file=${PID_FILE}"
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ case "$1" in
|
|||||||
echo "Starting $DESC"
|
echo "Starting $DESC"
|
||||||
rm -rf $PID_PATH || return 1
|
rm -rf $PID_PATH || return 1
|
||||||
install -d --mode=0755 -o $RUN_AS -g $RUN_AS $PID_PATH || return 1
|
install -d --mode=0755 -o $RUN_AS -g $RUN_AS $PID_PATH || return 1
|
||||||
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo "Stopping $DESC"
|
echo "Stopping $DESC"
|
||||||
@@ -56,7 +56,7 @@ case "$1" in
|
|||||||
restart|force-reload)
|
restart|force-reload)
|
||||||
echo "Restarting $DESC"
|
echo "Restarting $DESC"
|
||||||
start-stop-daemon --stop --pidfile $PID_FILE --retry 15
|
start-stop-daemon --stop --pidfile $PID_FILE --retry 15
|
||||||
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
N=/etc/init.d/$NAME
|
N=/etc/init.d/$NAME
|
||||||
|
|||||||
Reference in new issue
Block a user