# 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})"
-
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
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
}