summaryrefslogtreecommitdiff
path: root/extra/lighttpd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-08-08 23:14:38 +0000
committerroot <root@rshg054.dnsready.net>2011-08-08 23:14:38 +0000
commit2b6f5a28e2e55b46c1169228e1e56f3b18dd08b5 (patch)
treeebd7dccec211af75c9dfd55560b3e5f61420b784 /extra/lighttpd
parent665308e50fd95e984da057ab8ddb6505b596b841 (diff)
Mon Aug 8 23:14:38 UTC 2011
Diffstat (limited to 'extra/lighttpd')
-rw-r--r--extra/lighttpd/PKGBUILD8
-rw-r--r--extra/lighttpd/lighttpd.conf1
-rw-r--r--extra/lighttpd/lighttpd.rc.d38
3 files changed, 26 insertions, 21 deletions
diff --git a/extra/lighttpd/PKGBUILD b/extra/lighttpd/PKGBUILD
index a71c5c93e..d6bc1f95d 100644
--- a/extra/lighttpd/PKGBUILD
+++ b/extra/lighttpd/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 130222 2011-07-04 13:03:05Z pierre $
+# $Id: PKGBUILD 134666 2011-08-07 10:50:50Z pierre $
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
pkgname=lighttpd
pkgver=1.4.29
-pkgrel=1
+pkgrel=2
pkgdesc='a secure, fast, compliant and very flexible web-server'
license=('custom')
arch=('i686' 'x86_64')
@@ -19,9 +19,9 @@ options=('!libtool' 'emptydirs')
source=("http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${pkgver}.tar.bz2"
'lighttpd.rc.d' 'lighttpd.logrotate.d' 'lighttpd.conf')
md5sums=('e6e67b09986cb504db630b5a86b2dd76'
- '369f2eea6231342b514ca4777bf395c8'
+ '268386e71f5748dc1d887b9a0ab65589'
'913e2157fa78d990c32146f387d44c2b'
- '2803a9ee7f20409c69f1566d2d90720e')
+ 'acdaa94299e6299cb5085e6d88babeca')
build() {
cd $srcdir/$pkgname-$pkgver
diff --git a/extra/lighttpd/lighttpd.conf b/extra/lighttpd/lighttpd.conf
index 8e8ab69e7..4ca1b23a4 100644
--- a/extra/lighttpd/lighttpd.conf
+++ b/extra/lighttpd/lighttpd.conf
@@ -6,7 +6,6 @@ server.port = 80
server.username = "http"
server.groupname = "http"
server.document-root = "/srv/http"
-server.pid-file = "/var/run/lighttpd/lighttpd.pid"
server.errorlog = "/var/log/lighttpd/error.log"
dir-listing.activate = "enable"
index-file.names = ( "index.html" )
diff --git a/extra/lighttpd/lighttpd.rc.d b/extra/lighttpd/lighttpd.rc.d
index 345e889ae..88f0a1474 100644
--- a/extra/lighttpd/lighttpd.rc.d
+++ b/extra/lighttpd/lighttpd.rc.d
@@ -4,24 +4,13 @@
. /etc/rc.d/functions
-get_pid_file() {
- /usr/sbin/lighttpd -p -f /etc/lighttpd/lighttpd.conf 2>/dev/null | grep server.pid-file | sed -E 's/.*"(.+)"/\1/'
-}
+pid_file='/var/run/lighttpd/lighttpd-angel.pid'
get_pid() {
- local pid_file=$(get_pid_file)
- local pid=$(pidof -o %PPID lighttpd-angel)
- # only needed when updating from 1.4.26
- # TODO: remove in future versions
- local old_pid=$(pidof -o %PPID lighttpd)
if [ -r "${pid_file}" ]; then
cat "${pid_file}"
- elif [ -n "${pid}" ]; then
- echo "${pid}"
- elif [ -n "${old_pid}" ]; then
- echo "${old_pid}"
else
- echo ''
+ pgrep -f /usr/sbin/lighttpd-angel
fi
}
@@ -43,7 +32,7 @@ test_config() {
stat_die
fi
- local piddir=$(dirname "$(get_pid_file)")
+ local piddir=$(dirname "${pid_file}")
if [ ! -d "${piddir}" ]; then
install -d -m755 -o http -g http "${piddir}"
fi
@@ -60,6 +49,7 @@ start() {
if [ $? -gt 0 ]; then
stat_die
else
+ echo $! > "${pid_file}"
add_daemon lighttpd
stat_done
fi
@@ -75,7 +65,19 @@ stop() {
if [ $? -gt 0 ]; then
stat_fail
else
- local pid_file=$(get_pid_file)
+ [ -f "${pid_file}" ] && rm -f "${pid_file}"
+ rm_daemon lighttpd
+ stat_done
+ fi
+}
+
+gracefull-stop() {
+ stat_busy 'Stopping lighttpd gracefully'
+ local PID=$(get_pid)
+ [ -n "$PID" ] && kill -INT $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
[ -f "${pid_file}" ] && rm -f "${pid_file}"
rm_daemon lighttpd
stat_done
@@ -103,6 +105,10 @@ case "$1" in
test_config
stop
;;
+ gracefull-stop)
+ test_config
+ stop
+ ;;
reload)
test_config
reload
@@ -120,7 +126,7 @@ case "$1" in
ck_status lighttpd
;;
*)
- echo "usage: $0 {start|stop|reload|restart|status}"
+ echo "usage: $0 {start|stop|gracefull-stop|reload|restart|status}"
esac
exit 0