--- /etc/init.d/twistd 2012-02-23 01:10:00.000000000 -0500 +++ /tmp/twistd 2012-03-11 20:53:39.767591160 -0400 @@ -1,5 +1,7 @@ #!/sbin/runscript +: ${TWISTD_PIDFILE:='/var/run/${RC_SVCNAME}.pid'} + depend() { need net } @@ -7,19 +9,19 @@ start() { if [[ -z "${TWISTD_OPTS}" ]]; then eerror "TWISTD_OPTS is not set!" - eerror "You need to configure twistd in /etc/conf.d/twistd." + eerror "You need to configure twistd in /etc/conf.d/${RC_SVCNAME}" return 1 fi export PYTHONPATH - ebegin "Starting twistd" - start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \ - --exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \ + ebegin "Starting ${RC_SVCNAME}" + start-stop-daemon --start --quiet --pidfile ${TWISTD_PIDFILE} \ + --exec /usr/bin/twistd -- --pidfile ${TWISTD_PIDFILE} \ ${TWISTD_OPTS} - eend $? "Failed to start twistd" + eend $? "Failed to start ${RC_SVCNAME}" } stop() { - ebegin "Stopping twistd" - start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid - eend $? "Failed to stop twistd" + ebegin "Stopping ${RC_SVCNAME}" + start-stop-daemon --stop --quiet --pidfile ${TWISTD_PIDFILE} + eend $? "Failed to stop ${RC_SVCNAME}" }