diff --git a/etc/conf.d/lighttpd b/etc/conf.d/lighttpd new file mode 100644 index 0000000..e002c9b --- /dev/null +++ b/etc/conf.d/lighttpd @@ -0,0 +1,2 @@ +LIGHTTPD_CONF=/etc/lighttpd/lighttpd.conf +LIGHTTPD_LOGFILE=/var/log/lighttpd/lighttpd-angel.log diff --git a/etc/rc.d/lighttpd b/etc/rc.d/lighttpd index c1efe41..824fc56 100755 --- a/etc/rc.d/lighttpd +++ b/etc/rc.d/lighttpd @@ -2,10 +2,11 @@ . /etc/rc.conf . /etc/rc.d/functions +. /etc/conf.d/lighttpd get_pid_file() { - /usr/sbin/lighttpd -p -f /etc/lighttpd/lighttpd.conf 2>/dev/null | grep server.pid-file | cut -d= -f2 + /usr/sbin/lighttpd -p -f ${LIGHTTPD_CONF} 2>/dev/null | grep server.pid-file | cut -d= -f2 } get_pid() { @@ -32,7 +33,7 @@ test_config() { stat_die fi - if [ ! -r /etc/lighttpd/lighttpd.conf ]; then + if [ ! -r ${LIGHTTPD_CONF} ]; then stat_append '(/etc/lighttpd/lighttpd.conf not found)' stat_die fi @@ -45,7 +46,7 @@ test_config() { fi done - /usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 + /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null 2>&1 if [ $? -gt 0 ]; then stat_append '(error in /etc/lighttpd/lighttpd.conf)' stat_die @@ -59,7 +60,7 @@ start() { local PID=$(get_pid) if [ -z "$PID" ]; then - nohup /usr/sbin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf >>/var/log/lighttpd/lighttpd-angel.log 2>&1 & + nohup /usr/sbin/lighttpd-angel -D -f ${LIGHTTPD_CONF} >> ${LIGHTTPD_LOGFILE} 2>&1 & if [ $? -gt 0 ]; then stat_die else