Merge pull request #4423 from pprindeville/lighttpd-use-procd

lighttpd: use procd-based init.d script
This commit is contained in:
Daniel Golle 2017-06-05 14:47:32 +02:00 committed by GitHub
commit 3548a8b2c2
2 changed files with 19 additions and 15 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lighttpd PKG_NAME:=lighttpd
PKG_VERSION:=1.4.45 PKG_VERSION:=1.4.45
PKG_RELEASE:=3 PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x

View File

@ -1,26 +1,30 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org # Copyright (C) 2006-2011 OpenWrt.org
SERVICE_USE_PID=1
START=50 START=50
STOP=50
start() { USE_PROCD=1
PROG=/usr/sbin/lighttpd
validate_conf() {
$PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 || {
echo "validation failed"
return 1
}
}
start_service() {
user_exists http || user_add http user_exists http || user_add http
[ -d /var/log/lighttpd ] || { [ -d /var/log/lighttpd ] || {
mkdir -m 0775 -p /var/log/lighttpd mkdir -m 0775 -p /var/log/lighttpd
chgrp www-data /var/log/lighttpd chgrp www-data /var/log/lighttpd
} }
service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
} validate_conf || exit 1
stop() { procd_open_instance
service_stop /usr/sbin/lighttpd procd_set_param command $PROG -D -f /etc/lighttpd/lighttpd.conf
} procd_close_instance
restart() {
/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf || exit 1
stop
start
} }