X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=lighttpd.init;h=aaf4d5fae66946360f8b500221b0320f8a21e928;hb=20f769ed465d651842ace7a4d676d1620f90dbdf;hp=618e1bc738de7d530c746d147f935f2b317b8d91;hpb=a3d8706ec923e0d61e5eb2783f1f258d05c8ac53;p=packages%2Flighttpd.git diff --git a/lighttpd.init b/lighttpd.init old mode 100644 new mode 100755 index 618e1bc..aaf4d5f --- a/lighttpd.init +++ b/lighttpd.init @@ -10,12 +10,18 @@ # Source function library . /etc/rc.d/init.d/functions +upstart_controlled + # Get network config . /etc/sysconfig/network # Get service config [ -f /etc/sysconfig/lighttpd ] && . /etc/sysconfig/lighttpd +DAEMON=/usr/sbin/lighttpd +ANGEL_DAEMON=/usr/sbin/lighttpd-angel +CONFIGFILE=/etc/lighttpd/lighttpd.conf + # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then @@ -27,7 +33,17 @@ else fi configtest() { - env SHELL=/bin/sh lighttpd -t -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS + # check for deprecated config options that cause bad side effects + # TODO: should remove the deprecated options in pld after some time being warned out + local out + out=$(env SHELL=/bin/sh $DAEMON -f $CONFIGFILE $HTTPD_OPTS -p 2>&1 | grep -oE '(url.rewrite|url.rewrite-final)[[:space:]]') + if [ -n "$out" ]; then + # make it unique, format nicely + out=$(echo "$out" | sort -u | xargs | sed -e 's/ /, /g') + echo >&2 "WARNING: found deprecated '$out', convert to 'url.rewrite-final' recommented, See http://redmine.lighttpd.net/issues/2379" + fi + + env SHELL=/bin/sh $DAEMON -t -f $CONFIGFILE $HTTPD_OPTS } # wrapper for configtest @@ -38,7 +54,7 @@ checkconfig() { # run config test and display report (status action) show "Checking %s configuration" "Lighttpd Web Server"; busy local out - out=`configtest 2>&1` + out=$(configtest 2>&1) RETVAL=$? if [ $RETVAL = 0 ]; then ok @@ -70,10 +86,10 @@ start() { msg_starting "Lighttpd Web Server"; busy if is_yes "${LIGHT_ANGEL}"; then daemon --fork --pidfile /var/run/lighttpd-angel.pid --makepid \ - env SHELL=/bin/sh lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS 1>&2 + env SHELL=/bin/sh $ANGEL_DAEMON -D -f $CONFIGFILE $HTTPD_OPTS else - env SHELL=/bin/sh lighttpd -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS + env SHELL=/bin/sh $DAEMON -f $CONFIGFILE $HTTPD_OPTS fi RETVAL=$? if [ $RETVAL -eq 0 ]; then @@ -126,7 +142,7 @@ reload() { return fi - checkconfig + checkconfig 1 msg_reloading "Lighttpd Web Server" if is_yes "${LIGHT_ANGEL}"; then @@ -138,7 +154,7 @@ reload() { # sending INT signal will make lighttpd close all listening sockets and # wait for client connections to terminate. killproc --pidfile /var/run/lighttpd.pid lighttpd -INT - env SHELL=/bin/sh lighttpd -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS + env SHELL=/bin/sh lighttpd -f $CONFIGFILE $HTTPD_OPTS fi RETVAL=$? } @@ -193,7 +209,7 @@ case "$1" in checkconfig 1 ;; show-config) - env SHELL=/bin/sh lighttpd -p -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS + env SHELL=/bin/sh $DAEMON -p -f $CONFIGFILE $HTTPD_OPTS ;; status) if is_yes "${LIGHT_ANGEL}"; then