aboutsummaryrefslogtreecommitdiffstats
path: root/extra/mini_httpd/mini_httpd.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-03 07:10:03 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-03 07:10:03 +0000
commitb6b6ef01345b8fc161ab4151e5c3faa2ff3779e8 (patch)
tree130610fd5e559004f9a328ffa98f8b393a211115 /extra/mini_httpd/mini_httpd.initd
parent1b0bfcaa3da101e5630e3cf719a2d7bd4ed5b3f2 (diff)
downloadaports-b6b6ef01345b8fc161ab4151e5c3faa2ff3779e8.tar.gz
aports-b6b6ef01345b8fc161ab4151e5c3faa2ff3779e8.tar.bz2
aports-b6b6ef01345b8fc161ab4151e5c3faa2ff3779e8.tar.xz
extra/mini_httpd: openrc fixes. add support for multiple instances
fixes #57
Diffstat (limited to 'extra/mini_httpd/mini_httpd.initd')
-rw-r--r--extra/mini_httpd/mini_httpd.initd24
1 files changed, 10 insertions, 14 deletions
diff --git a/extra/mini_httpd/mini_httpd.initd b/extra/mini_httpd/mini_httpd.initd
index ccaf53d31f..4460a539ef 100644
--- a/extra/mini_httpd/mini_httpd.initd
+++ b/extra/mini_httpd/mini_httpd.initd
@@ -3,27 +3,23 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/mini_httpd/files/mini_httpd.init,v 1.2 2007/08/26 21:20:21 bangert Exp $
+pidfile=/var/run/${SVCNAME}.pid
+
depend() {
need net
}
start() {
- ebegin "Starting mini_httpd"
- if [ ! -d "$MINI_HTTPD_DOCROOT" ]; then
- eend 1 "MINI_HTTPD_DOCROOT not set correctly in /etc/conf.d/mini_httpd"
- exit 1
- fi
- start-stop-daemon --quiet --start --startas /usr/sbin/mini_httpd \
- --pidfile /var/run/mini_httpd.pid -- ${MINI_HTTPD_OPTS}
+ ebegin "Starting $SVCNAME"
+ start-stop-daemon --quiet --start --exec /usr/sbin/mini_httpd \
+ --pidfile $pidfile -- -i $pidfile \
+ ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf}
eend $?
}
stop() {
- local rc
-
- ebegin "Stopping mini_httpd"
- start-stop-daemon --quiet --stop --pidfile /var/run/mini_httpd.pid
- rc=$?
- rm -f /var/run/mini_httpd.pid
- eend $rc
+ ebegin "Stopping $SVCNAME"
+ start-stop-daemon --quiet --stop --pidfile $pidfile
+ eend $?
}
+