diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2015-05-14 14:09:52 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-15 11:44:06 +0000 |
commit | 8df570d9915181c49b21f33244fa21bf970b4002 (patch) | |
tree | ca5a7261bd02b5367c5a544f238c790a8eae7769 /testing/sipwise-sems/sems.initd | |
parent | a824d445bbe2abb22ca2362898b7e72054639120 (diff) | |
download | aports-8df570d9915181c49b21f33244fa21bf970b4002.tar.bz2 aports-8df570d9915181c49b21f33244fa21bf970b4002.tar.xz |
new aport: sipwise-sems [3.8.1.1]
This is sipwise.com's fork of sems, based on 1.6.0-dev + nightlies
Diffstat (limited to 'testing/sipwise-sems/sems.initd')
-rwxr-xr-x | testing/sipwise-sems/sems.initd | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/sipwise-sems/sems.initd b/testing/sipwise-sems/sems.initd new file mode 100755 index 0000000000..fda1e8a838 --- /dev/null +++ b/testing/sipwise-sems/sems.initd @@ -0,0 +1,48 @@ +#!/sbin/openrc-run +# SIP Express Media Server configuration file +# Follows Gentoo/AlpineLinux standards +# GPL 2 License - N. Angelacos 2011 + +SVC="${SVCNAME#*.}" +SEMS_CFG_FILE=${SEMS_CFG_FILE:-/etc/sems/${SVC}.conf} +SEMS_PIDDIR=/var/run/sems +SEMS_PIDFILE=${SEMS_PIDFILE:-${SEMS_PIDDIR}/${SVC}.pid} +SEMS_BINARY=${SEMS_BINARY:-/usr/sbin/sems} +SEMS_USER=${SEMS_USER:-sems} +SEMS_GROUP=${SEMS_GROUP:-sems} + +checkconfig() { + if [ ! -f "${SEMS_CFG_FILE}" ] ; then + eerror "You need a "${SEMS_CFG_FILE}" file to run sems" + return 1; + fi +} + + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + mkdir -p "${SEMS_PIDDIR}" + chown ${SEMS_USER}:${SEMS_GROUP} "${SEMS_PIDDIR}" + + start-stop-daemon --start --exec "${SEMS_BINARY}" \ + --pidfile "${SEMS_PIDFILE}" \ + --wait ${SEMS_WAIT:-500} \ + -- \ + -f "${SEMS_CFG_FILE}" \ + -P "${SEMS_PIDFILE}" \ + -u "${SEMS_USER}" \ + -g "${SEMS_GROUP}" + eend $? +} + +stop() { + if [ "${RC_CMD}" = "restart" ] ; then + checkconfig || return 1 + fi + + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec "${SEMS_BINARY}" \ + --pidfile "${SEMS_PIDFILE}" --quiet + eend $? +} |