Commit 5e9ddf38 authored by Natanael Copa's avatar Natanael Copa

main/mini_httpd: added logrotate script

moved default logfile and pid fiels to /var/{run,log}/mini_httpd/

fixes #80
parent d28f3110
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mini_httpd
pkgver=1.19
pkgrel=1
pkgrel=2
pkgdesc="Small forking webserver with ssl and ipv6 support"
url="http://www.acme.com/software/mini_httpd/"
license="BSD"
depends=
depends="logrotate"
makedepends="openssl-dev"
subpackages="$pkgname-doc"
source="http://www.acme.com/software/mini_httpd/$pkgname-$pkgver.tar.gz
$pkgname.conf.sample
$pkgname.initd
$pkgname.logrotate
"
build() {
......@@ -35,8 +36,12 @@ 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.logrotate \
"$pkgdir"/etc/logrotate.d/mini_httpd
install -d "$pkgdir"/var/run/mini_httpd "$pkgdir"/var/log/mini_httpd
}
md5sums="7c68293ad265ecfe2edea917912f6f1f mini_httpd-1.19.tar.gz
ec656aadd4751a3f4f6e8c788a5237f2 mini_httpd.conf.sample
804e5cba1537bddac195e64b5b50d609 mini_httpd.initd"
bca5b3b1cdc00cf31f0b54797518b893 mini_httpd.conf.sample
7cfcf81d75be204ecb60eb18fa4d96a7 mini_httpd.initd
915683e9c7e1cef7ce9b1bbaa31ab680 mini_httpd.logrotate"
......@@ -27,7 +27,9 @@ dir=/var/www/localhost/htdocs
chroot
#nochroot
##
logfile=/var/log/mini_httpd.log
## The init.d script will override logfile here, so you need to set the
## MINI_HTTPD_OPTS in /etc/conf.d/ in order to enable the logfile option here
#logfile=/var/log/mini_httpd/mini_httpd.log
##
#charset=iso-8859-1
##
......
......@@ -3,7 +3,7 @@
# 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
pidfile=/var/run/mini_httpd/${SVCNAME}.pid
depend() {
need net
......@@ -13,7 +13,7 @@ start() {
ebegin "Starting $SVCNAME"
start-stop-daemon --quiet --start --exec /usr/sbin/mini_httpd \
--pidfile $pidfile -- -i $pidfile \
${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf}
${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l /var/log/mini_httpd/${SVCNAME}.log}
eend $?
}
......
/var/log/mini_httpd/*.log {
weekly
missingok
copytruncate
rotate 7
compress
notifempty
sharedscripts
postrotate
for i in /var/run/mini_httpd*.pid /var/run/mini_httpd/*.pid; do \
if [ -f "$i" ]; then \
/etc/init.d/$(basename $i .pid) restart > /dev/null 2>&1 || true ; \
fi; \
done;
endscript
}
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