add a quick start at a "dashboard" customer list, mostly for internal use for starters
[freeside.git] / bin / freeside-init
1 #! /bin/sh
2 #
3 # start the freeside job queue daemon
4
5 #PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
6 DAEMON=/usr/local/bin/freeside-queued
7 NAME=freeside-queued
8 DESC="freeside job queue daemon"
9 USER="ivan"
10
11 test -f $DAEMON || exit 0
12
13 set -e
14
15 case "$1" in
16   start)
17         echo -n "Starting $DESC: "
18 #       start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid -b -m\
19 #               --exec $DAEMON
20         $DAEMON $USER &
21         echo "$NAME."
22         ;;
23   stop)
24         echo -n "Stopping $DESC: "
25         start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
26                 --exec $DAEMON
27         echo "$NAME."
28         rm /var/run/$NAME.pid
29         ;;
30   #reload)
31         #
32         #       If the daemon can reload its config files on the fly
33         #       for example by sending it SIGHUP, do it here.
34         #
35         #       If the daemon responds to changes in its config file
36         #       directly anyway, make this a do-nothing entry.
37         #
38         # echo "Reloading $DESC configuration files."
39         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
40         #       /var/run/$NAME.pid --exec $DAEMON
41   #;;
42   restart|force-reload)
43         #
44         #       If the "reload" option is implemented, move the "force-reload"
45         #       option to the "reload" entry above. If not, "force-reload" is
46         #       just the same as "restart".
47         #
48         $0 stop
49         sleep 1
50         $0 start
51         ;;
52   *)
53         N=/etc/init.d/$NAME
54         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
55         echo "Usage: $N {start|stop|restart|force-reload}" >&2
56         exit 1
57         ;;
58 esac
59
60 exit 0