summaryrefslogtreecommitdiff
path: root/www-servers/lighttpd/files/lighttpd.initd
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-03-26 23:49:20 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-03-26 23:49:20 +0100
commitbba9240061dc3f8bd15bce304f0abc421024b453 (patch)
tree8dd96b420853934f26b1e90877892d10058af739 /www-servers/lighttpd/files/lighttpd.initd
parent33a162ec97deacfba497638836f91478fb0e9406 (diff)
downloadoverlay-bba9240061dc3f8bd15bce304f0abc421024b453.tar.gz
overlay-bba9240061dc3f8bd15bce304f0abc421024b453.tar.bz2
overlay-bba9240061dc3f8bd15bce304f0abc421024b453.zip
add patched lighttpd
Diffstat (limited to 'www-servers/lighttpd/files/lighttpd.initd')
-rw-r--r--www-servers/lighttpd/files/lighttpd.initd67
1 files changed, 67 insertions, 0 deletions
diff --git a/www-servers/lighttpd/files/lighttpd.initd b/www-servers/lighttpd/files/lighttpd.initd
new file mode 100644
index 0000000..71c72ba
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.initd
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.13 2009/04/03 20:59:34 bangert Exp $
+
+opts="reload graceful"
+
+depend() {
+ need net
+ use mysql logger spawn-fcgi ldap slapd netmount dns
+ after famd
+ after sshd
+}
+
+checkconfig() {
+ if [ ! -f "${LIGHTTPD_CONF}" ] ; then
+ ewarn "${LIGHTTPD_CONF} does not exist."
+ return 1
+ fi
+
+ /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting lighttpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \
+ --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}"
+ eend $?
+}
+
+stop() {
+ local rv=0
+ ebegin "Stopping lighttpd"
+ start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}"
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+ checkconfig || return 1
+
+ ebegin "Re-opening lighttpd log files"
+ start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \
+ --signal HUP
+ eend $?
+}
+
+graceful() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+ checkconfig || return 1
+
+ ebegin "Gracefully stopping lighttpd"
+ start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \
+ --signal INT
+ if eend $? ; then
+ rm -f "${LIGHTTPD_PID}"
+ start
+ fi
+}