diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-19 09:11:50 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-19 09:18:46 +0000 |
commit | 4e8b12d3f6298deff7893b9e13673058d029eb62 (patch) | |
tree | 7461a8d02aee51de13bc0233b089ab267198ec06 /testing/sems/sems.initd | |
parent | bd48ba5d5a0acc9688555721762769d797bda02c (diff) | |
download | aports-4e8b12d3f6298deff7893b9e13673058d029eb62.tar.bz2 aports-4e8b12d3f6298deff7893b9e13673058d029eb62.tar.xz |
testing/sems: remake of sems (1.3.1)
based on fedoras package and patches.
We split it in a similar way as fedora
Diffstat (limited to 'testing/sems/sems.initd')
-rwxr-xr-x | testing/sems/sems.initd | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/sems/sems.initd b/testing/sems/sems.initd new file mode 100755 index 000000000..3b6973b55 --- /dev/null +++ b/testing/sems/sems.initd @@ -0,0 +1,48 @@ +#!/sbin/runscript +# 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 $? +} |