add debugging to agent.cgi, make sure warnings are turned off when parsing templates...
[freeside.git] / init.d / freeside-init
1 #! /bin/sh
2 #
3 # chkconfig: 345 86 16
4 # description: Freeside daemons
5
6 QUEUED_USER=%%%QUEUED_USER%%%
7
8 FREESIDE_PATH="%%%FREESIDE_PATH%%%"
9
10 SELFSERVICE_USER=%%%SELFSERVICE_USER%%%
11 SELFSERVICE_MACHINES="%%%SELFSERVICE_MACHINES%%%"
12
13 case "$1" in
14   start)
15         # Start daemons.
16         echo -n "Starting freeside-queued: "
17         freeside-queued $QUEUED_USER
18         echo "done."
19
20         for MACHINE in $SELFSERVICE_MACHINES; do
21           echo -n "Starting freeside-selfservice-server to $MACHINE: "
22           freeside-selfservice-server $SELFSERVICE_USER $MACHINE
23           echo "done."
24         done
25
26         ;;
27   stop)
28         # Stop daemons.
29         echo -n "Stopping freeside-queued: "
30         kill `cat /var/run/freeside-queued.pid`
31         echo "done."
32
33         if [ -e /var/run/freeside-selfservice-server.$SELFSERVICE_USER.pid ]
34         then
35           echo -n "Stopping (old) freeside-selfservice-server: "
36           kill `cat /var/run/freeside-selfservice-server.$SELFSERVICE_USER.pid`
37           rm /var/run/freeside-selfservice-server.$SELFSERVICE_USER.pid
38         fi
39
40         for MACHINE in $SELFSERVICE_MACHINES; do
41           echo -n "Stopping freeside-selfservice-server to $MACHINE: "
42           kill `cat /var/run/freeside-selfservice-server.$SELFSERVICE_USER.$MACHINE.pid`
43           echo "done."
44         done
45
46         ;;
47
48   restart)
49         $0 stop
50         $0 start
51         ;;
52   *)
53         echo "Usage: freeside {start|stop|restart}"
54         exit 1
55 esac
56
57 exit 0
58