From 8f6922302486fa1cc1112ff8b3daddb48c3260f2 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 10 Apr 2011 04:43:11 +0000 Subject: Sun Apr 10 04:43:11 UTC 2011 --- extra/lighttpd/lighttpd.rc.d | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'extra/lighttpd/lighttpd.rc.d') diff --git a/extra/lighttpd/lighttpd.rc.d b/extra/lighttpd/lighttpd.rc.d index 5f851d63e..32fdd0d08 100644 --- a/extra/lighttpd/lighttpd.rc.d +++ b/extra/lighttpd/lighttpd.rc.d @@ -5,7 +5,7 @@ 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 /etc/lighttpd/lighttpd.conf 2>/dev/null | grep server.pid-file | sed -E 's/.*"(.+)"/\1/' } get_pid() { @@ -37,20 +37,17 @@ test_config() { stat_die fi - local d - for d in /var/{run,log,cache}/lighttpd; do - if [ ! -d $d ]; then - stat_append "(directory $d not found)" - stat_die - fi - done - /usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 if [ $? -gt 0 ]; then stat_append '(error in /etc/lighttpd/lighttpd.conf)' stat_die fi + local piddir=$(dirname "$(get_pid_file)") + if [ ! -d "{$piddir}" ]; then + install -d -m755 -o http -g http "${piddir}" + fi + stat_done } -- cgit v1.2.3-54-g00ecf