From e40e15b5844bc49174d4798d710e264b97cdeaf4 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 7 Dec 2006 02:47:41 +0000 Subject: fixed bug in overridding DAEMON in default/pd and added comments svn path=/trunk/; revision=6682 --- scripts/debian/init.d/pd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts/debian/init.d/pd') diff --git a/scripts/debian/init.d/pd b/scripts/debian/init.d/pd index 05ba46b0..3e44e392 100755 --- a/scripts/debian/init.d/pd +++ b/scripts/debian/init.d/pd @@ -30,9 +30,6 @@ DAEMON=/usr/bin/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -# Gracefully exit if the package has been removed. -test -x $DAEMON || exit 0 - # options RUNPDDAEMON=no USER=nobody @@ -49,6 +46,9 @@ then . /etc/default/$NAME fi +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + if [ "$RUNPDDAEMON" != "yes" ];then echo "Pd not configured to run as a daemon. Edit /etc/default/$NAME." exit 1 @@ -60,6 +60,7 @@ then exit 1 fi +# this is meant for running Pd as a server, so it turns off everything PARAMS="-nogui -noaudio -nomidi $OPTIONS" # for the log file @@ -69,7 +70,8 @@ DATE=`date +20%y-%m-%d_%H.%M.%S` # Function that starts the daemon/service. # d_start() { -# /bin/su - arw -c "/usr/bin/pd -nogui" > /tmp/pd-`date +20%y-%m-%d_%H.%M.%S`.log 2>&1 & +# if you want a log, use this line (until Pd gets syslog support) +# /bin/su - $USER -c "$DAEMON $PARAMS" > /tmp/pd-$DATE.log 2>&1 & start-stop-daemon -v --start --quiet --background --make-pidfile \ --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- $PARAMS } @@ -80,8 +82,7 @@ d_start() { d_stop() { start-stop-daemon --stop --quiet --pidfile $PIDFILE \ --user $USER --name $NAME --retry 5 -# echo "quit;quit;quit;" | /usr/bin/pdsend $PORT -# sleep 5 +# if you used the /bin/su command in d_start(), you need this to stop Pd: # /usr/bin/killall -KILL pd || echo "Warning: $DESC was not running" } -- cgit v1.2.1