aboutsummaryrefslogtreecommitdiffstats
path: root/main/mini_httpd/mini_httpd.initd
diff options
context:
space:
mode:
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 $?
}
-