Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156068 - net-analyzer/nagios-core: /etc/init.d/nagios should set HOME
Summary: net-analyzer/nagios-core: /etc/init.d/nagios should set HOME
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 172480
  Show dependency tree
 
Reported: 2006-11-23 15:22 UTC by Wolfram Schlich (RETIRED)
Modified: 2007-05-08 21:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schlich (RETIRED) gentoo-dev 2006-11-23 15:22:02 UTC
When /etc/init.d/nagios starts the nagios daemon as user 'nagios',
HOME is kept as /root instead of setting it to, for example, /var/nagios.
See:

$ pgrep -n -u nagios -x nagios | xargs -n 1 -i cat /proc/{}/environ | xargs -0 -n 1 echo | grep '^HOME='

That makes it impossible to use a .my.cnf in ~nagios/ for check_mysql
or other check plugins that could use or even need special config
files in ~nagios/ (check_by_ssh is another example).

Solution:
1. Do not set the home directory of 'nagios' to /dev/null, use /var/nagios, /home/nagios or something else that can be used to put files into.
2. Add "-e HOME=/path/to/nagios/home" to the start-stop-daemon call in /etc/init.d/nagios

I have tried it and it works fine.
Comment 1 Tobias Scherbaum (RETIRED) gentoo-dev 2007-05-08 21:39:01 UTC
Fixed in nagios-core-2.9 and nagios-plugins-1.4.6.