Commit b6b6ef01 authored by Natanael Copa's avatar Natanael Copa

extra/mini_httpd: openrc fixes. add support for multiple instances

fixes #57
parent 1b0bfcaa
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mini_httpd
pkgver=1.19
pkgrel=0
pkgrel=1
pkgdesc="Small forking webserver with ssl and ipv6 support"
url="http://www.acme.com/software/mini_httpd/"
license="BSD"
depends="uclibc openssl"
depends=
makedepends="openssl-dev"
subpackages="$pkgname-doc"
source="http://www.acme.com/software/mini_httpd/$pkgname-$pkgver.tar.gz
$pkgname.confd
$pkgname.conf.sample
$pkgname.initd
"
......@@ -36,10 +35,8 @@ build() {
install -D -m644 ../mini_httpd.conf.sample \
"$pkgdir"/etc/mini_httpd.conf
install -D -m755 ../mini_httpd.initd "$pkgdir"/etc/init.d/mini_httpd
install -D -m644 ../mini_httpd.confd "$pkgdir"/etc/conf.d/mini_httpd
}
md5sums="7c68293ad265ecfe2edea917912f6f1f mini_httpd-1.19.tar.gz
8ec70211497d79a26d33006b0ce19aa0 mini_httpd.confd
fd62c1809f658400acf2082eacd08bb8 mini_httpd.conf.sample
ec52d2db1ce52f1b088d474aeefe9da8 mini_httpd.initd"
ec656aadd4751a3f4f6e8c788a5237f2 mini_httpd.conf.sample
804e5cba1537bddac195e64b5b50d609 mini_httpd.initd"
......@@ -13,6 +13,9 @@ port=80
#port=443
user=nobody
##
## The DOCROOT
dir=/var/www/localhost/htdocs
##
## CGI:
## ? match a single char
## * matches any string excluding "/"
......@@ -25,7 +28,6 @@ chroot
#nochroot
##
logfile=/var/log/mini_httpd.log
pidfile=/var/run/mini_httpd.pid
##
#charset=iso-8859-1
##
......
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/mini_httpd/files/mini_httpd.confd-1.19,v 1.2 2007/08/26 21:20:21 bangert Exp $
## Config file for /etc/init.d/mini_httpd
## the startup-dir of mini_httpd is the docroot, so we specify it here
## and the init-script does a "cd" prior to startup:
MINI_HTTPD_DOCROOT="/var/www/localhost/htdocs"
## There are 2 ways to configure mini_httpd:
## 1) specify all params on the cmd-line
## 2) use a config-file (and start with "-C <conf-file>")
## Note: 1) and 2) can be mixed.
##
## We choose 1) here -- if you have a more complicated setup read
## mini_httpd(8) for details on 2).
# MINI_HTTPD_OPTS="-p 8080 -u nobody -r -i /var/run/mini_httpd.pid -l /var/log/mini_httpd.log -d ${MINI_HTTPD_DOCROOT}"
## to add cgi-support you should switch over to a config-file, a sample can
## be found in your DOCDESTTREE (/usr/share/doc/mini_httpd-xxxx) named
## mini_httpd.conf.sample.gz
## copy the sample to /etc/mini_httpd.conf and replace the MINI_HTTPD_OPTS-line
## above by:
MINI_HTTPD_OPTS="-C /etc/mini_httpd.conf"
......@@ -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 $?
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment