Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 454366

Summary: www-servers/lighttpd - user/group hardcoded in init script, breaks when ran under different credentials
Product: Gentoo Linux Reporter: Eugene Rosenzweig <ugn>
Component: [OLD] ServerAssignee: Markos Chandras (RETIRED) <hwoarang>
Severity: minor CC: hwoarang, tomwij, zlg
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Eugene Rosenzweig 2013-01-28 02:40:41 UTC
the /etc/init.d/lighttpd script hard-codes the user/group under which lighttpd runs. The line is:
checkpath -d -q -m 0750 -o lighttpd:lighttpd /var/run/lighttpd/
This line no longer functions correctly when lighttpd runs under different credentials which is supported by server.username/server.groupname settings in lighttpd.conf

Reproducible: Always

Steps to Reproduce:
Change server.username/server.groupname settings in lighttpd.conf
/etc/init.d/lighttpd restart

Actual Results:  
Warning is produced:
checkpath: owner `lighttpd:lighttpd' not found

Is the checkpath line even needed? The pid file is created in /var/run rather than /var/run/lighttpd
The issue can be fixed in /etc/conf.d/lighttpd using the same method to extract user/group values from conf file as used to extract the pid file path:
LIGHTTPD_PID="$(/usr/bin/awk '/^{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
LIGHTTPD_USER="$(/usr/bin/awk '/^server.username/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
LIGHTTPD_GROUP="$(/usr/bin/awk '/^server.groupname/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
Comment 1 zlg (RETIRED) gentoo-dev 2016-09-12 09:40:47 UTC
This is now in git. Resync and remerge to get the updated initd file.

Be sure to double-check the permissions of your server's directories (mine complained at /var/log/lighttpd), as a mismatch will result in the init-script failing to work. Once permissions are good, you can change the given user at will via /etc/lighttpd/lighttpd.conf as expected.

Commit-ID: 0db692284d2789ec6fa2ca82d630bd825f8a7f01

Marking as RESOLVED. Reopen if this doesn't work for you.