diff options
Diffstat (limited to 'init.d/freeside-init')
-rw-r--r-- | init.d/freeside-init | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/init.d/freeside-init b/init.d/freeside-init new file mode 100644 index 000000000..a62b187ab --- /dev/null +++ b/init.d/freeside-init @@ -0,0 +1,79 @@ +#! /bin/sh +# +# chkconfig: 345 86 16 +# description: Freeside daemons + +QUEUED_USER=%%%QUEUED_USER%%% + +SELFSERVICE_USER=%%%SELFSERVICE_USER%%% +SELFSERVICE_MACHINES="%%%SELFSERVICE_MACHINES%%%" + +#INSTALLSCRIPT/INSTALLSITEBIN from Makefile.PL +PATH="$PATH:/usr/local/bin" +export PATH + +case "$1" in + start) + # Start daemons. + echo -n "Starting freeside-queued: " + 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." + + 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." + + #and + killall freeside-queued + + echo -n "Stopping freeside-sqlradius-radacctd: " + kill `cat /var/run/freeside-sqlradius-radacctd.pid` + echo "done." + + echo -n "Stopping freeside-prepaidd: " + kill `cat /var/run/freeside-prepaidd.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 + |