diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2011-04-08 05:28:50 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-07 23:57:19 +0000 |
commit | b839f9b0ed0e56f0e710bcee1e004610e3574165 (patch) | |
tree | 9ed1bef008d7643d2dc97e4d82ca4ab4f08b23ba /testing | |
parent | a6c3d43084215d86a3420cf1d6003bf8ea81941d (diff) | |
download | aports-b839f9b0ed0e56f0e710bcee1e004610e3574165.tar.bz2 aports-b839f9b0ed0e56f0e710bcee1e004610e3574165.tar.xz |
testing/sems/sems.initd: allow multiple sems instances
Diffstat (limited to 'testing')
-rw-r--r-- | testing/sems/sems.initd | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/testing/sems/sems.initd b/testing/sems/sems.initd index 9cf98a185..0e96f8a21 100644 --- a/testing/sems/sems.initd +++ b/testing/sems/sems.initd @@ -1,8 +1,17 @@ #!/sbin/runscript +# SIP Express Media Server configuration file +# Follows Gentoo/AlpineLinux standards +# GPL 2 License - N. Angelacos 2011 +CONFDIR="/etc/sems" +SVC="${SVCNAME#*.}" +if [ -n "${SVC}" ] && [ "${SVCNAME}" != "sems" ]; then + SEMSPID="/var/run/sems/${SVC}.pid" + else + SEMSPID="/var/run/sems/sems.pid" + fi +SEMSCONF="${CONFDIR}/${SVC}.conf" daemon=/usr/sbin/sems -pidfile=/var/run/sems/sems.pid -conffile=/etc/sems/sems.conf depend() { need net @@ -10,18 +19,19 @@ depend() { } start() { - ebegin "Starting sems" - start-stop-daemon --start --quiet --pidfile $pidfile --exec $daemon \ + ebegin "Starting ${SVCNAME}" + echo $SEMSPID $SEMSCONF + start-stop-daemon --start --quiet --pidfile $SEMSPID --exec $daemon \ -- \ -u sems \ -g sems \ - -P $pidfile \ - -f $conffile + -P $SEMSPID \ + -f $SEMSCONF eend $? } stop() { - ebegin "Stopping sems" - start-stop-daemon --stop --quiet --pidfile $pidfile + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet --pidfile $SEMSPID eend $? } |