summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/webcit/files/webcit.init.d')
-rw-r--r--www-servers/webcit/files/webcit.init.d26
1 files changed, 17 insertions, 9 deletions
diff --git a/www-servers/webcit/files/webcit.init.d b/www-servers/webcit/files/webcit.init.d
index 942dd9bab..d523c3420 100644
--- a/www-servers/webcit/files/webcit.init.d
+++ b/www-servers/webcit/files/webcit.init.d
@@ -1,28 +1,36 @@
#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
+CITSERVER=${SVCNAME#*.}
+if [ -n "${CITSERVER}" ] && [ ${SVCNAME} != "webcit" ]; then
+ WCPID="/var/run/webcit.${CITSERVER}.pid"
+else
+ WCPID="/var/run/webcit.pid"
+fi
+
depend() {
need net
}
start() {
- ebegin "Starting WebCit"
- start-stop-daemon --start --quiet --background \
- --exec /usr/sbin/webcit -- $WEBCIT_OPTS
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --background \
+ --exec /usr/sbin/webcit --make-pidfile \
+ --pidfile "${WCPID}" -- $WEBCIT_OPTS
eend $? "Failed to start WebCit"
}
stop() {
- ebegin "Stopping WebCit"
- start-stop-daemon --stop --quiet \
- --exec /usr/sbin/webcit
- eend $? "Failed to stop WebCit"
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --exec /usr/sbin/webcit --pidfile "${WCPID}"
+ eend $? "Failed to stop ${SVCNAME}"
}
restart() {
- ebegin "Restarting WebCit"
+ ebegin "Restarting ${SVCNAME}"
svc_stop && sleep 3 && svc_start
eend $? "Failed to restart WebCit"
}