aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sems/sems.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/sems/sems.initd')
-rw-r--r--testing/sems/sems.initd26
1 files changed, 18 insertions, 8 deletions
diff --git a/testing/sems/sems.initd b/testing/sems/sems.initd
index 9cf98a185e..0e96f8a21a 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 $?
}