aboutsummaryrefslogtreecommitdiffstats
path: root/main/mini_httpd/mini_httpd.initd
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2017-02-07 11:55:27 +0200
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-02-07 11:10:38 +0000
commitc872afe7630d0713ecf4eb8fd52656700f86c395 (patch)
tree48ed68b2f121f69208e95ca50870540811ce4c9b /main/mini_httpd/mini_httpd.initd
parent8aa674ad330af521c81be36fe7e9d7b46308ac5d (diff)
downloadaports-c872afe7630d0713ecf4eb8fd52656700f86c395.tar.bz2
aports-c872afe7630d0713ecf4eb8fd52656700f86c395.tar.xz
main/mini_httpd: upgrade to 1.26
Diffstat (limited to 'main/mini_httpd/mini_httpd.initd')
-rw-r--r--[-rwxr-xr-x]main/mini_httpd/mini_httpd.initd31
1 files changed, 15 insertions, 16 deletions
diff --git a/main/mini_httpd/mini_httpd.initd b/main/mini_httpd/mini_httpd.initd
index 91a67ccda3..bd8d62fd60 100755..100644
--- a/main/mini_httpd/mini_httpd.initd
+++ b/main/mini_httpd/mini_httpd.initd
@@ -1,32 +1,31 @@
#!/sbin/openrc-run
-# 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.init,v 1.2 2007/08/26 21:20:21 bangert Exp $
description="Small HTTP server"
+extra_started_commands="reload"
+start_stop_daemon_args="--quiet"
-pidfile=/var/run/mini_httpd/${SVCNAME}.pid
+cfgfile=/etc/mini_httpd/$RC_SVCNAME.conf
+pidfile=/run/mini_httpd/$RC_SVCNAME.pid
+command=/usr/sbin/mini_httpd
+required_files="$cfgfile"
depend() {
need net
after firewall
}
-start() {
- local logfile=$(awk -F= '$1 == "logfile" { print $2 }' /etc/mini_httpd/${SVCNAME}.conf 2>/dev/null)
- : ${logfile:=/var/log/mini_httpd/${SVCNAME}.log}
+start_pre() {
+ ebegin
checkpath -d ${pidfile%/*}
- checkpath -d ${logfile%/*}
- ebegin "Starting $SVCNAME"
- start-stop-daemon --quiet --start --exec /usr/sbin/mini_httpd \
- --pidfile $pidfile -- -i $pidfile \
- ${MINI_HTTPD_OPTS:--C /etc/mini_httpd/${SVCNAME}.conf -l ${logfile}}
+ local logfile=$(awk -F= '$1 == "logfile" { print $2 }' $cfgfile 2>/dev/null)
+ [ -n "$logfile" ] && checkpath -d ${logfile%/*}
+ command_args="-i $pidfile -C $cfgfile ${logfile:+-l $logfile} $command_args"
+ $command -V -C $cfgfile >/dev/null
eend $?
}
-stop() {
- ebegin "Stopping $SVCNAME"
- start-stop-daemon --quiet --stop --pidfile $pidfile
+reload() {
+ ebegin "Reloading $RC_SVCNAME configuration"
+ start-stop-daemon --signal HUP --pidfile $pidfile
eend $?
}
-