--- lighttpd.orig 2010-01-28 00:27:32.000000000 +0100 +++ lighttpd 2010-01-28 00:27:38.000000000 +0100 @@ -26,6 +26,7 @@ : ${lighttpd_enable="NO"} : ${lighttpd_conf="/usr/local/etc/lighttpd.conf"} : ${lighttpd_pidfile="/var/run/${name}.pid"} +: ${lighttpd_allowed_env=""} command=/usr/local/sbin/lighttpd command_args="-f ${lighttpd_conf}" @@ -39,6 +40,21 @@ check_cmd="checkconfig" extra_commands="reload check" +start_precmd="${name}_start_precmd" + +lighttpd_start_precmd() +{ + E= + for i in ${lighttpd_allowed_env}; do + eval _val="\$$i" + if [ "${_val}_x" != "_x" ]; then + eval _add="$i=$_val" + E="${E} ${_add}" + fi + done + command="env - ${E} ${command}" +} + checkconfig() { echo "Performing sanity check on ${name} configuration:"