Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 53 lines (44 sloc) 1.291 kb
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: fyrqd
# Required-Start: $local_fs $syslog postgresql
# Required-Stop: $local_fs $syslog postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fyrqd is a daemon running the WriteToThem queue
# Description: fyrqd run the WriteToThem queue to send emails and faxes to representatives
### END INIT INFO
#
# !!(*= $daemon_name *)!! Start the WriteToThem queue daemon
NAME=!!(*= $daemon_name *)!!
DAEMON=/data/vhost/!!(*= $vhost *)!!/writetothem/bin/fyrqd
PIDFILE=/data/vhost/!!(*= $vhost *)!!/fyrqd.pid
DUSER=!!(*= $user *)!!
trap "" 1
case "$1" in
start)
echo -n "Starting WriteToThem queue daemon: $NAME"
start-stop-daemon --start --pidfile $PIDFILE --chuid $DUSER --exec $DAEMON > /dev/null
;;
stop)
echo -n "Stopping WriteToThem queue daemon: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
;;
restart)
echo -n "Restarting WriteToThem queue daemon: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
start-stop-daemon --start --pidfile $PIDFILE --chuid $DUSER --exec $DAEMON > /dev/null
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
if [ $? -eq 0 ]; then
echo .
exit 0
else
echo " failed"
exit 1
fi
Jump to Line
Something went wrong with that request. Please try again.