Summary: | www-servers/lighttpd init scripts should use --pidfile for start-stop-daemon | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Eric Brown <eric.brown> |
Component: | Current packages | Assignee: | www-servers Herd (OBSOLETE) <www-servers+disabled> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | ejona86, rockoo |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Eric Brown
2005-11-10 09:07:33 UTC
I am having trouble getting start-stop-daemon to work with lighttpd/pid files... I think when lighttpd daemonizes, start-stop-daemon doesn't get returned the pid (so I have empty pid files). Does anyone know why this is happening and if there's a better way to have init scripts control multiple lighttpd processes? Solution: set the server.pid-file variable in each lighttpd.conf you use... Then lighty will write its own pids, and start-stop-daemon will be able to kill it via --pidfile yes - as you say. set an appropriate value of server.pid-file in each config file - copy the init script to use the new pid- and config-file. closing the bug. please reopen if you meant something else. I was wanting to have multiple instances of lighttpd as well. I think that a note should be placed in the init script noting that the pid file should match the pid file in the lighttpd config. In my opinion, a better solution would be to give the --make-pidfile argument to start-stop-daemon. This would create the wanted pidfile. The problem with this is that when lighttpd daemonizes itself the pid of the server process changes. So giving -D (don't daemonize) to lighttpd and --background to start-stop-daemon gives the correct pid. start-stop-daemon --start --quiet --background \ --pidfile ${LIGHTTPD_PID} --make-pidfile \ --exec /usr/sbin/lighttpd -- -D -f ${LIGHTTPD_CONF} That is the only change that would be made to the init script. Then the pid file can be removed from lighttpd.conf. I agree. As a webserver, lighttpd is basic systems infrastructure. Not elegantly supporting multiple instances out of the box is a bad thing. In my case, I wanted multiple instances for testing purposes. Manual modification to support this should be minimised by improving the init script as Eric suggested. I don't think it's right to mark this bug as 'RESOLVED WORKSFORME'. |