diff --git a/build/ripping-cluster-worker.conf-gentoo b/build/ripping-cluster-worker.conf-gentoo new file mode 100644 index 0000000..631bdb7 --- /dev/null +++ b/build/ripping-cluster-worker.conf-gentoo @@ -0,0 +1,5 @@ +# Which user to run the worker daemon as +USER="media" + +# File to store the running daemon's PID in +PID_FILE="/var/run/ripping-cluster-worker.pid" diff --git a/build/ripping-cluster-worker.init-gentoo b/build/ripping-cluster-worker.init-gentoo index 0abdb95..559f5fa 100644 --- a/build/ripping-cluster-worker.init-gentoo +++ b/build/ripping-cluster-worker.init-gentoo @@ -2,8 +2,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PID_FILE="/var/run/ripping-cluster-worker.pid" - depend() { need localmount net use dns logger puppetmaster netmount nfsmount @@ -13,7 +11,8 @@ start() { ebegin "Starting ripping-cluster-worker" start-stop-daemon --start --quiet \ --background --make-pidfile --pidfile ${PID_FILE} \ - --exec /usr/bin/php /usr/lib/ripping-cluster/worker/ripping-cluster-worker.php + --chuid ${USER} --user ${USER} \ + --exec /usr/bin/php /usr/lib/ripping-cluster/source/worker/ripping-cluster-worker.php eend $? "Failed to start ripping-cluster-worker" } @@ -22,8 +21,10 @@ stop() { start-stop-daemon --stop --quiet \ --pidfile ${PID_FILE} local ret=$? - eend ${ret} "Failed to stop puppet" - rm -f ${PID_FILE} + + eend ${ret} "Failed to stop ripping-cluster-worker" + ${ret} || rm -f ${PID_FILE} + return ${ret} }