aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeswitch/freeswitch.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-06-03 19:47:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-03 19:47:32 +0000
commit8136831e39f64dac7667d9318ea80ed821a12903 (patch)
tree591d8455f8f6b3797aef9d55431e56a2455ebd5d /main/freeswitch/freeswitch.initd
parentf48632069e0bee30cf4c9a4d2c443900062fc767 (diff)
downloadaports-8136831e39f64dac7667d9318ea80ed821a12903.tar.bz2
aports-8136831e39f64dac7667d9318ea80ed821a12903.tar.xz
main/freeswitch: fix for init.d script
fixes #355
Diffstat (limited to 'main/freeswitch/freeswitch.initd')
-rwxr-xr-xmain/freeswitch/freeswitch.initd71
1 files changed, 38 insertions, 33 deletions
diff --git a/main/freeswitch/freeswitch.initd b/main/freeswitch/freeswitch.initd
index 0538fff56b..91df7e2acf 100755
--- a/main/freeswitch/freeswitch.initd
+++ b/main/freeswitch/freeswitch.initd
@@ -4,55 +4,60 @@
# $Header: $
depend() {
- need net
+ need net
}
opts="reload"
+pidfile=/var/run/freeswitch/freeswitch.pid
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 $?
+ 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
+ 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 $?
+ ebegin "Stopping Freeswitch"
+ start-stop-daemon --quiet --stop \
+ --pidfile $pidfile \
+ --retry 10 \
+ --exec /usr/bin/freeswitch
+ eend $?
}
reload() {
- start-stop-daemon --stop --signal 1 --quiet --pidfile \
- /var/run/freeswitch.pid --name freeswitch
- return 0
+ start-stop-daemon --stop --signal 1 --quiet \
+ --pidfile $pidfile --name freeswitch
+ return 0
}