diff --git a/etc/init.d/pandora b/etc/init.d/pandora index 1c51319..50a6b11 100755 --- a/etc/init.d/pandora +++ b/etc/init.d/pandora @@ -19,7 +19,7 @@ PANDORA_BASE=/srv/pandora DAEMON_USER="pandora" DAEMON_NAME=bin/gunicorn_django DAEMON="$PANDORA_BASE/$DAEMON_NAME" -DAEMON_ARGS="--bind 127.0.0.1:2620 --timeout 90 --log-level info --log-file /var/log/pandora/pandora.log --workers 5 $PANDORA_BASE/pandora.settings.py" +DAEMON_ARGS="--bind 127.0.0.1:2620 --timeout 90 --log-level info --log-file /var/log/pandora/pandora.log --workers 5 $PANDORA_BASE/pandora/settings.py" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -46,11 +46,12 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - killall oxframe - start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ + test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $DAEMON_USER:$DAEMON_USER /var/log/pandora) + + start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ + start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER --startas $DAEMON \ --make-pidfile --background --exec $DAEMON -- $DAEMON_ARGS \ || return 2 } @@ -65,8 +66,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \ - -c $DAEMON_USER --name $DAEMON_NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks diff --git a/etc/init.d/pandora-encoding b/etc/init.d/pandora-encoding index c0cb66b..e608e7f 100755 --- a/etc/init.d/pandora-encoding +++ b/etc/init.d/pandora-encoding @@ -46,11 +46,11 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - killall oxframe + test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $DAEMON_USER:$DAEMON_USER /var/log/pandora) start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ + start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER -startas $DAEMON \ --make-pidfile --background --exec $DAEMON -- $DAEMON_ARGS \ || return 2 } @@ -65,8 +65,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \ - -c $DAEMON_USER --name $DAEMON_NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks diff --git a/etc/init.d/pandora-tasks b/etc/init.d/pandora-tasks index 5f00966..564fee4 100755 --- a/etc/init.d/pandora-tasks +++ b/etc/init.d/pandora-tasks @@ -46,7 +46,7 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - killall oxframe + test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $DAEMON_USER:$DAEMON_USER /var/log/pandora) start-stop-daemon --start --quiet --pidfile $PIDFILE -c $DAEMON_USER \ --exec $DAEMON --test > /dev/null \ || return 1 @@ -65,8 +65,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \ - -c $DAEMON_USER --name $DAEMON_NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks