From fe6eb62b5515fc820c9842fe2fd6f49659df6afd Mon Sep 17 00:00:00 2001 From: Wilco Baan Hofman Date: Sun, 5 May 2013 19:13:38 +0200 Subject: [PATCH] Fix init script for pidfile access rights --- siahsd-init-script | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/siahsd-init-script b/siahsd-init-script index 6c416ac..9a7454e 100755 --- a/siahsd-init-script +++ b/siahsd-init-script @@ -22,7 +22,9 @@ PIDFILE=/var/run/siahsd.pid start() { echo -n "Starting SIA-HS Daemon: " - if start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER --exec $DAEMON -- $DAEMON_ARGS; then + touch "$PIDFILE" + chown "$USER": "$PIDFILE" + if start-stop-daemon --start --quiet --pidfile "$PIDFILE" --chuid "$USER" --exec "$DAEMON" -- $DAEMON_ARGS; then echo "siahsd." else echo "FAILED." @@ -32,7 +34,7 @@ start() { stop() { echo -n "Stopping SIA-HS Daemon: " - if start-stop-daemon --stop --quiet --chuid $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $DAEMON; then + if start-stop-daemon --stop --quiet --chuid "$USER" --retry=TERM/30/KILL/5 --pidfile "$PIDFILE" --exec "$DAEMON"; then echo "siahsd." else echo "FAILED."