Nagios start/stop script not working on Solaris 10 system


#1

I compiled Nagios 3.0.4 on a Solaris 10 system using the following configure string:

./configure --prefix=/space/nagios --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include --with-nagios-user=na
gios --with-nagios-group=nagios --with-temp-dir=/space/nagios/tmp --with-init-dir=/etc/init.d --with-lockfile=/space/nagio
s/var/nagios.lock --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios --with-httpd-conf=/var/apache/conf --enable-embedded
-perl --with-mail=/usr/bin/mailx

I have my Nagios configuration files setup and they are working properly as the command: **nagios -v …/etc/nagios.cfg **returns no errors.

If I run the /etc/init.d/nagios script, it will return an exit status of zero stating that it ran successfully, however, there are no nagios processes running. I tried adding my PATH and LD_LIBRARY_PATH strings from my profile to the top of the Nagios start/stop script and it still will not work. The only way I can currently start nagios is by issuing the command: nohup /space/nagios/bin/nagios /space/nagios/etc/nagios.cfg &
By issuing that command, I can see the monitoring in the web interface and can select on the various sections within the interface, etc. with no problems.

I would like to know why the script will not work from /etc/init.d when I execute it manually. When I do attempt to start Nagios using the start/stop script, the following message is written to the nagios.log file.

Lockfile ‘/space/nagios/var/nagios.log’ does not contain a valid PID ([122535000)[/b]


#2

Heh, I’ve tried to search the web for the problem and saw your post about the same problem on solaris forum. Just to clear out the problem for the rest of the people here:
The problem happened because sunsysadm2003 specified the argument:
–with-lockfile=/space/nagios/var/nagios.lock
and in the nagios.cfg there is different file specified to be the .lock file