From d111393bd6af6561aa0e965b65a69b27f23c0642 Mon Sep 17 00:00:00 2001 From: Ruud Burger Date: Tue, 12 Mar 2013 08:21:23 +0100 Subject: [PATCH 1/3] Remove PID path --- init/ubuntu | 3 --- 1 file changed, 3 deletions(-) diff --git a/init/ubuntu b/init/ubuntu index b93f69a0..ece63b09 100644 --- a/init/ubuntu +++ b/init/ubuntu @@ -24,7 +24,6 @@ DAEMON=/usr/bin/python # Path to store PID file PID_FILE=/var/run/couchpotato.pid -PID_PATH=$(dirname $PID_FILE) # script name NAME=couchpotato @@ -44,8 +43,6 @@ set -e case "$1" in start) echo "Starting $DESC" - rm -rf $PID_PATH || return 1 - install -d --mode=0755 -o $RUN_AS $PID_PATH || return 1 start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS ;; stop) From 5e852d05eebee6c7279f9a4c81e68f37806e9caf Mon Sep 17 00:00:00 2001 From: Ruud Burger Date: Tue, 12 Mar 2013 08:29:29 +0100 Subject: [PATCH 2/3] Only remove PID file --- init/ubuntu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/ubuntu b/init/ubuntu index ece63b09..4b18bb74 100644 --- a/init/ubuntu +++ b/init/ubuntu @@ -24,6 +24,7 @@ DAEMON=/usr/bin/python # Path to store PID file PID_FILE=/var/run/couchpotato.pid +PID_PATH=$(dirname $PID_FILE) # script name NAME=couchpotato @@ -43,6 +44,8 @@ set -e case "$1" in start) echo "Starting $DESC" + rm -rf $PID_FILE || return 1 + install -d --mode=0755 -o $RUN_AS $PID_PATH || return 1 start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS ;; stop) From ed068f09b0b63bd3b103a856ecfd257f57bffbda Mon Sep 17 00:00:00 2001 From: Ruud Burger Date: Tue, 12 Mar 2013 10:40:20 +0100 Subject: [PATCH 3/3] Only chown PID file --- init/ubuntu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/ubuntu b/init/ubuntu index 4b18bb74..495efe69 100644 --- a/init/ubuntu +++ b/init/ubuntu @@ -24,7 +24,6 @@ DAEMON=/usr/bin/python # Path to store PID file PID_FILE=/var/run/couchpotato.pid -PID_PATH=$(dirname $PID_FILE) # script name NAME=couchpotato @@ -45,7 +44,8 @@ case "$1" in start) echo "Starting $DESC" rm -rf $PID_FILE || return 1 - install -d --mode=0755 -o $RUN_AS $PID_PATH || return 1 + touch $PID_FILE + chown $RUN_AS $PID_FILE start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS ;; stop)