X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from sp4.qcslink.com (sp4.qcslink.com [200.35.147.4]) by lists.alpinelinux.org (Postfix) with ESMTP id 432311EBFCC for ; Thu, 7 Apr 2011 21:34:37 +0000 (UTC) Received: from sp4.qcslink.com (localhost.localdomain [127.0.0.1]) by sp4.qcslink.com (Postfix) with ESMTP id 547F71A46A; Thu, 7 Apr 2011 17:34:37 -0400 (EDT) Received: from localhost.localdomain (c-67-188-63-60.hsd1.ca.comcast.net [67.188.63.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nangel@nothome.org) by sp4.qcslink.com (Postfix) with ESMTPSA id B75471A469; Thu, 7 Apr 2011 17:34:36 -0400 (EDT) From: Nathan Angelacos To: alpine-devel@lists.alpinelinux.org Cc: Nathan Angelacos Subject: [alpine-devel] [PATCH] testing/sems/sems.initd: allow multiple sems instances Date: Fri, 8 Apr 2011 05:28:50 +0000 Message-Id: <1302240530-3153-1-git-send-email-nangel@alpinelinux.org> X-Mailer: git-send-email 1.7.4.2 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- 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 9cf98a1..0e96f8a 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 $? } -- 1.7.4.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---