diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-05-03 06:54:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-05-03 06:54:53 +0000 |
commit | bf277d94c5aab5af8fbe8a4e175379e6f2682245 (patch) | |
tree | e0093c387cc7e5948c3b112d0a48d80bb3c58c50 /main/lighttpd/lighttpd.initd | |
parent | 8d571bb611a8909d72cf6debe552533281571735 (diff) | |
download | aports-bf277d94c5aab5af8fbe8a4e175379e6f2682245.tar.bz2 aports-bf277d94c5aab5af8fbe8a4e175379e6f2682245.tar.xz |
main/lighttpd: set /var/{run,log}/lighttpd permission on start
Needed when server.user and server.group is not set to default
value and we run from RAM.
fixes #606
Diffstat (limited to 'main/lighttpd/lighttpd.initd')
-rw-r--r-- | main/lighttpd/lighttpd.initd | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/lighttpd/lighttpd.initd b/main/lighttpd/lighttpd.initd index 6b02bdf43f..a0bcc0110e 100644 --- a/main/lighttpd/lighttpd.initd +++ b/main/lighttpd/lighttpd.initd @@ -11,6 +11,11 @@ depend() { after famd firewall sshd } +_confopt() { + /usr/sbin/lighttpd -p -f ${LIGHTTPD_CONF} | awk -F = \ + "/$1/"' {sub(/^ *"/, "", $2); sub(/" */, "", $2); print $2}' +} + checkconfig() { if [ ! -f "${LIGHTTPD_CONF}" ] ; then ewarn "${LIGHTTPD_CONF} does not exist." @@ -22,6 +27,9 @@ checkconfig() { start() { checkconfig || return 1 + local _user=$(_confopt server.user) + local _group=$(_confopt server.group) + chown $_user:$_group /var/*/lighttpd ebegin "Starting lighttpd" start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ |