nagios 4.0.6 - init script bug
Posted: Mon Jul 14, 2014 7:25 am
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:
Then I try to start nagios, and get permission denied errors:
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:
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.
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
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
- Line 63: NagiosLockDir is set to "/var/lock/subsys" despite setting --with-lockfile during configure.
- Line 89-90, 97-98, 105-106: Config test tries to work with /var/run/nagios.configtest, despite setting --with-prefix during configure.
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.