summaryrefslogtreecommitdiffstats
path: root/main/freeswitch/freeswitch.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/freeswitch/freeswitch.initd')
-rwxr-xr-xmain/freeswitch/freeswitch.initd58
1 files changed, 58 insertions, 0 deletions
diff --git a/main/freeswitch/freeswitch.initd b/main/freeswitch/freeswitch.initd
new file mode 100755
index 00000000..0538fff5
--- /dev/null
+++ b/main/freeswitch/freeswitch.initd
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: $
+
+depend() {
+ need net
+}
+
+opts="reload"
+
+start() {
+ local OPTS
+
+ [ -n "${FREESWITCH_USER}" ] && \
+ OPTS="${OPTS} -u ${FREESWITCH_USER}"
+
+ [ -n "${FREESWITCH_GROUP}" ] && \
+ OPTS="${OPTS} -g ${FREESWITCH_GROUP}"
+
+ [ -n "${FREESWITCH_OPTS}" ] && \
+ OPTS="${OPTS} ${FREESWITCH_OPTS}"
+
+ ebegin "Starting Freeswitch"
+ limits
+ start-stop-daemon --start --quiet --exec /usr/bin/freeswitch \
+ -- -nc -conf /etc/freeswitch -log /var/log/freeswitch \
+ -run /var/run/freeswitch -db /var/lib/freeswitch/db \
+ -htdocs /usr/share/freeswitch/htdocs \
+ -scripts /usr/share/freeswitch/scripts ${OPTS}
+ eend $?
+}
+
+# Recomended ULIMIT settings
+# http://tinyurl.com/2dr467l (i,q,u,x not suppoted)
+
+limits() {
+ ulimit -c unlimited
+ ulimit -d unlimited
+ ulimit -f unlimited
+ ulimit -n 999999
+ ulimit -v unlimited
+ ulimit -s 244
+ ulimit -l unlimited
+}
+
+stop() {
+ ebegin "Stopping Freeswitch"
+ /usr/bin/freeswitch -stop
+ eend $?
+}
+
+reload() {
+ start-stop-daemon --stop --signal 1 --quiet --pidfile \
+ /var/run/freeswitch.pid --name freeswitch
+ return 0
+}
+