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