I'm using Debian 7.8 (wheezy), and lighttpd 1.4.31 with nagios 3.4.1.
when I start lighttpd normally (as root), everything works as expected:
/etc/init.d/lighttpd start
However, when nagios starts lighttpd, everything issues a 404 error, and nothing is logged to /var/log/lighttpd/access.log
or /var/log/lighttpd/error.log
. I can mimic the same behavior manually by issuing the following command as root:
su - nagios -s /usr/bin/sudo /etc/init.d/lighttpd start
The nagios daemon has sudo access, as defined in /etc/sudoers.d/nagios
:
nagios ALL=(root) NOPASSWD: /etc/init.d/lighttpd *
What am I missing? What's the difference between starting lighttpd directly as root, and doing it as the nagios user via sudo?