I'm using NRPE and I a rather annoying problem. I need a couple temporary files written to the home directory of the user NRPE is running under (nagios).
I checked that the /etc/passwd entry for Nagios is correctly pointing to /home/nagios and that NRPE is set to execute under the Nagios user. The service reliably is trying to write to my user's folder (when restarting the service with sudo) or to / (when rebooting).
The official documentation doesn't have anything on this subject. How can I make this happen?
EDIT - this only occurs from items executed via NRPE. It is not a permissions issue.
Adding a small script that sets the HOME variable and then calls the intended executable does get around the issue but that is an ugly and non scalable solution.