diff options
author | Leonardo Arena <rnalrd@gmail.com> | 2009-07-27 06:39:43 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@gmail.com> | 2009-07-27 06:39:43 +0000 |
commit | c66164b230fc33d7a903bbd1da6f803c2cadd0e2 (patch) | |
tree | 5b2c145554a597182448ac64167be76fd904d392 /main/lighttpd/lighttpd.initd | |
parent | aad5f530b5a45159e9420d654173345006bde998 (diff) | |
parent | db7bf56b641e8ebb35d6f24ca8bca0b3b9e45c19 (diff) | |
download | aports-c66164b230fc33d7a903bbd1da6f803c2cadd0e2.tar.bz2 aports-c66164b230fc33d7a903bbd1da6f803c2cadd0e2.tar.xz |
Merge branch 'master' of git://dev.alpinelinux.org/aports
Diffstat (limited to 'main/lighttpd/lighttpd.initd')
-rw-r--r-- | main/lighttpd/lighttpd.initd | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/main/lighttpd/lighttpd.initd b/main/lighttpd/lighttpd.initd new file mode 100644 index 0000000000..80aaacc5e5 --- /dev/null +++ b/main/lighttpd/lighttpd.initd @@ -0,0 +1,67 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3,v 1.2 2007/10/12 20:54:46 swegener Exp $ + +opts="reload graceful" + +depend() { + need net + use mysql logger spawn-fcgi ldap slapd + 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 +} |