nagios 4.0.6 - init script bug

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
GeoffMontee
Posts: 4
Joined: Mon Jul 14, 2014 6:54 am

nagios 4.0.6 - init script bug

Post by GeoffMontee »

I'm compiling Nagios 4.0.6 from source in a CentOS 6 environment in which I don't have root or sudo privileges. Therefore, Nagios only has a few users, groups, and directories it can work with.

I compiled with the following:

Code: Select all

./configure --prefix=/opt/nagios --with-nagios-user=monitor --with-nagios-group=monitor --with-command-user=monitor --with-command-group=monitor --with-init-dir=/home/monitor/scripts --with-lockfile=/home/monitor/nagios.lock --with-httpd-conf=/home/monitor/conf/httpd
make all
make install
mkdir -p /home/monitor/scripts
make --ignore-errors install-init
make install-commandmode
make install-config
mkdir -p /home/monitor/conf/httpd
make --ignore-errors install-webconf
make install-exfoliation
Then I try to start nagios, and get permission denied errors:

Code: Select all

> bash /home/monitor/scripts/nagios start
Starting nagios: /home/monitor/scripts/nagios: line 89: /var/run/nagios.configtest: Permission denied
chmod: cannot access `/var/run/nagios.configtest': No such file or directory
touch: cannot touch `/var/lock/subsys/nagios': Permission denied
There seems to be several places in the init script that ignore configure flags and opt for the standard Red Hat locations instead. Some examples:
  1. Line 63: NagiosLockDir is set to "/var/lock/subsys" despite setting --with-lockfile during configure.
  2. Line 89-90, 97-98, 105-106: Config test tries to work with /var/run/nagios.configtest, despite setting --with-prefix during configure.
For my current setup, I can obviously alter the init script to make it work for myself. But I thought I would report this bug, so you could fix it in future releases.

This is unrelated, but you'll notice that I had to pass --ignore-errors to make during two of the steps. To avoid derailing this thread, I'll post the issue that caused that in a separate thread.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios 4.0.6 - init script bug

Post by abrist »

I will bring one of our core devs into this thread. Could you by chance open an issue on github as well?
https://github.com/NagiosEnterprises/nagioscore/issues
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
GeoffMontee
Posts: 4
Joined: Mon Jul 14, 2014 6:54 am

Re: nagios 4.0.6 - init script bug

Post by GeoffMontee »

Thanks for the response. Posted as issue #7.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios 4.0.6 - init script bug

Post by slansing »

Great! Just keep an eye on that tracker link for an update from the Devs when they have an answer for you. We can likely chalk this up to non-standard usage, but they will let you know. Thank you for posting the link for others in the future!
Locked