summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2015-09-02 17:58:59 +0100
committerMarkos Chandras <hwoarang@gentoo.org>2015-09-02 18:19:01 +0100
commit8414107dc7f3df35ab6c2fa0cddd40463fdc639a (patch)
tree2183c4e74025293b628413b4931eb27f405ea640 /www-servers/lighttpd
parentsys-kernel/gentoo-sources: workqueue: Make flush_workqueue() available again ... (diff)
downloadgentoo-8414107dc7f3df35ab6c2fa0cddd40463fdc639a.tar.gz
gentoo-8414107dc7f3df35ab6c2fa0cddd40463fdc639a.tar.bz2
gentoo-8414107dc7f3df35ab6c2fa0cddd40463fdc639a.zip
www-servers/lighttpd: Improve server.pid-file detection in openrc init script. Bug #366811
Package-Manager: portage-2.2.20.1
Diffstat (limited to 'www-servers/lighttpd')
-rw-r--r--www-servers/lighttpd/files/lighttpd.confd4
-rw-r--r--www-servers/lighttpd/files/lighttpd.initd9
2 files changed, 6 insertions, 7 deletions
diff --git a/www-servers/lighttpd/files/lighttpd.confd b/www-servers/lighttpd/files/lighttpd.confd
index f3afb07a58e1..c7733de7e75e 100644
--- a/www-servers/lighttpd/files/lighttpd.confd
+++ b/www-servers/lighttpd/files/lighttpd.confd
@@ -6,7 +6,3 @@
# Location of the lighttpd configuration file
LIGHTTPD_CONF="/etc/lighttpd/lighttpd.conf"
-
-# Location of the lighttpd pid file
-LIGHTTPD_PID="$(/usr/bin/awk '/^server.pid-file/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
-
diff --git a/www-servers/lighttpd/files/lighttpd.initd b/www-servers/lighttpd/files/lighttpd.initd
index 23c0983fd77c..8abe3bae5d24 100644
--- a/www-servers/lighttpd/files/lighttpd.initd
+++ b/www-servers/lighttpd/files/lighttpd.initd
@@ -5,6 +5,8 @@
extra_started_commands="reload graceful"
+LIGHTTPD_PID="$($(which lighttpd) -pf ${LIGHTTPD_CONF} | grep pid | cut -d '=' -f 2 | tr -d \\\" | tr -d [:space:])"
+
depend() {
need net
use mysql logger spawn-fcgi ldap slapd netmount dns
@@ -19,9 +21,10 @@ checkconfig() {
fi
if [ -z "${LIGHTTPD_PID}" ] ; then
- ewarn "server.pid-file variable in ${LIGHTTPD_CONF}"
- ewarn "is not set. Falling back to lighttpd.pid"
- LIGHTTPD_PID="/run/lighttpd.pid"
+ eerror "server.pid-file variable in ${LIGHTTPD_CONF}"
+ eerror "is not set. Please set this variable properly"
+ eerror "and try again"
+ return 1
fi
/usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null
}