mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Split init files into redhat ne and suse one (both need a bit of more care)
SPlit packages into language dependant ones git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6458 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
95
build/freeswitch.init.redhat
Normal file
95
build/freeswitch.init.redhat
Normal file
@@ -0,0 +1,95 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# /etc/rc.d/init.d/freeswitch
|
||||
#
|
||||
# The FreeSwitch Open Source Voice Platform
|
||||
#
|
||||
# chkconfig: - 89 14
|
||||
# processname: freeswitch
|
||||
# config: /opt/freeswitch/conf/freeswitch.conf
|
||||
# pidfile: /opt/freeswitch/log/freeswitch/pid
|
||||
#
|
||||
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Source options file
|
||||
if [ -f /etc/sysconfig/freeswitch ]; then
|
||||
. /etc/sysconfig/freeswitch
|
||||
fi
|
||||
|
||||
prog=freeswitch
|
||||
pidfile=/opt/freeswitch/log/freeswitch.pid
|
||||
FS_USER=freeswitch
|
||||
lockfile=/var/lock/subsys/freeswitch
|
||||
RETVAL=0
|
||||
|
||||
# <define any local shell functions used by the code that follows>
|
||||
|
||||
start() {
|
||||
echo -n "Starting $prog: "
|
||||
if [ -e $lockfile ]; then
|
||||
if [ -e $pidfile && [ -e /proc/`$pidfile` ]; then
|
||||
echo -n $"cannot start freeswitch: freeswitch is already running.";
|
||||
failure $"cannot start freeswitch: freeswitch already running.";
|
||||
echo
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
daemon --user $FS_USER --pidfile $pidfile $prog $FREESWITCH_ARGS
|
||||
RETVAL=$?
|
||||
[ $RETVAL -eq 0 ] && touch $lockfile;
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Shutting down $prog: "
|
||||
if [ ! -e $lockfile ]; then
|
||||
echo -n $"cannot stop $prog: $prog is not running."
|
||||
failure $"cannot stop $prog: $prog is not running."
|
||||
echo
|
||||
return 1;
|
||||
fi
|
||||
/opt/freeswitch/bin/freeswitch -stop
|
||||
killproc freeswitch
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $lockfile;
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
rhstatus() {
|
||||
status $prog;
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status $prog
|
||||
RETVAL=$?
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
reload)
|
||||
# <cause the service configuration to be reread, either with
|
||||
# kill -HUP or by restarting the daemons, in a manner similar
|
||||
# to restart above>
|
||||
;;
|
||||
condrestart)
|
||||
[ -f $pidfile ] && restart || :
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $prog {start|stop|status|reload|restart"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit $RETVAL
|
Reference in New Issue
Block a user