Fix init script for pidfile access rights

This commit is contained in:
Wilco Baan Hofman 2013-05-05 19:13:38 +02:00 committed by root
parent a081fb8920
commit fe6eb62b55

View file

@ -22,7 +22,9 @@ PIDFILE=/var/run/siahsd.pid
start() { start() {
echo -n "Starting SIA-HS Daemon: " 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." echo "siahsd."
else else
echo "FAILED." echo "FAILED."
@ -32,7 +34,7 @@ start() {
stop() { stop() {
echo -n "Stopping SIA-HS Daemon: " 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." echo "siahsd."
else else
echo "FAILED." echo "FAILED."