blob: 1acefdc412adf578186c0c298b542cc675ec45a6 (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
#!/bin/sh
#
# chkconfig: 345 86 16
# description: Freeside daemons
QUEUED_USER=%%%QUEUED_USER%%%
SELFSERVICE_USER=%%%SELFSERVICE_USER%%%
SELFSERVICE_MACHINES="%%%SELFSERVICE_MACHINES%%%"
IF=eth0
#INSTALLSCRIPT/INSTALLSITEBIN from Makefile.PL
PATH="$PATH:/usr/local/bin"
export PATH
[ -r /etc/default/freeside ] && . /etc/default/freeside
case "$1" in
start)
# Start daemons.
echo -n "Starting freeside-queued: "
#perl -MDBIx::Profile /usr/local/bin/freeside-queued $QUEUED_USER
freeside-queued $QUEUED_USER
#export NYTPROF="file=/usr/local/etc/freeside/nytprof.out"
#PERL5OPT="-d:NYTProf" freeside-queued $QUEUED_USER
echo "done."
echo -n "Starting freeside-sqlradius-radacctd: "
freeside-sqlradius-radacctd $QUEUED_USER
echo "done."
echo -n "Starting freeside-prepaidd: "
freeside-prepaidd $QUEUED_USER
echo "done."
echo -n "Starting freeside-cdrrewrited: "
freeside-cdrrewrited $QUEUED_USER
echo "done."
echo -n "Starting freeside-cdrd: "
freeside-cdrd $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
echo -n "Starting freeside-selfservice-xmlrpcd: "
freeside-selfservice-xmlrpcd $SELFSERVICE_USER
echo "done."
#ip=`/sbin/ifconfig $IF | grep 'inet addr:' | cut -d: -f2- | cut -d' ' -f1`
#cp /opt/rt3/etc/RT_SiteConfig.pm.ORIG /opt/rt3/etc/RT_SiteConfig.pm
#perl -pi -e "s/localhost/$ip/" /opt/rt3/etc/RT_SiteConfig.pm
;;
stop)
# Stop daemons.
echo -n "Stopping freeside-queued: "
[ -e /var/run/freeside-queued.pid ] && kill `cat /var/run/freeside-queued.pid`
#and
sleep 2;
killall freeside-queued
echo "done."
if [ -e /var/run/freeside-sqlradius-radacctd.pid ]; then
echo -n "Stopping freeside-sqlradius-radacctd: "
kill `cat /var/run/freeside-sqlradius-radacctd.pid`
echo "done."
fi
if [ -e /var/run/freeside-prepaidd.pid ]; then
echo -n "Stopping freeside-prepaidd: "
kill `cat /var/run/freeside-prepaidd.pid`
echo "done."
fi
if [ -e /var/run/freeside-cdrd.pid ]; then
echo -n "Stopping freeside-cdrd: "
kill `cat /var/run/freeside-cdrd.pid`
echo "done."
fi
if [ -e /var/run/freeside-cdrrewrited.pid ]; then
echo -n "Stopping freeside-cdrrewrited: "
kill `cat /var/run/freeside-cdrrewrited.pid`
echo "done."
fi
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
echo "done."
fi
if [ -z "$SELFSERVICE_MACHINES" ]; then SELFSERVICE_MACHINES='localhost'; fi
for MACHINE in $SELFSERVICE_MACHINES; do
if [ -e /var/run/freeside-selfservice-server.$SELFSERVICE_USER.$MACHINE.pid ]
then
echo -n "Stopping freeside-selfservice-server to $MACHINE: "
kill `cat /var/run/freeside-selfservice-server.$SELFSERVICE_USER.$MACHINE.pid`
echo "done."
fi
done
if [ -e /var/run/freeside/selfservice-xmlrpcd.pid ]; then
echo -n "Stopping freeside-selfservice-xmlrpcd: "
kill `cat /var/run/freeside/selfservice-xmlrpcd.pid`
echo "done."
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: freeside {start|stop|restart}"
exit 1
esac
exit 0
|