[bug-notifications] [nrpe 0003730]: svcadm disable cswnrpe does not gracefully handle missing pid_file param, hangs system on shutdown

Mantis Bug Tracker noreply at opencsw.org
Sat Jun 27 01:07:07 CEST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://opencsw.org/bugtrack/view.php?id=3730 
====================================================================== 
Reported By:                gadavis
Assigned To:                ja
====================================================================== 
Project:                    nrpe
Issue ID:                   3730
Category:                   regular use
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             2009-06-26 00:28 CEST
Last Modified:              2009-06-27 01:07 CEST
====================================================================== 
Summary:                    svcadm disable cswnrpe does not gracefully handle
missing pid_file param, hangs system on shutdown
Description: 
CSWnpre 2.12,REV=2009.06.18 fails to successfully shutdown on Solaris 10
SPARC. This causes something in the SMF framework to hang when the system
is init 6'd or init 1'd. The system must be Stop-A'd and rebooted.

When a manual svcadm enable/ svcadm disable is issued, the following is
observed in /var/svc/log/application-cswnrpe:default.log:

[ Jun 25 22:01:14 Executing start method
("/var/opt/csw/svc/method/svc-cswnrpe s
tart") ]
[ Jun 25 22:01:16 Method "start" exited with status 0 ]
[ Jun 25 22:02:12 Stopping because service disabled. ]
[ Jun 25 22:02:12 Executing stop method
("/var/opt/csw/svc/method/svc-cswnrpe st
op") ]
/usr/bin/kill[8]: kill: bad argument count
[ Jun 25 22:02:13 Method "stop" exited with status 0 ]

svcs -xv shows:
# svcs -xv cswnrpe
svc:/application/cswnrpe:default (?)
 State: online since June 25, 2009 10:02:12 PM UTC
   See: /var/svc/log/application-cswnrpe:default.log
Impact: None.

Digging a bit further, it appears that the stop method script does not
have any sort of error checking to see if pid_file is defined in nrpe.cfg.

This is a bit of a problem for those of us upgrading from an older version
of NRPE that didn't support the pid_file argument.

====================================================================== 

---------------------------------------------------------------------- 
 (0006344) gadavis (reporter) - 2009-06-27 01:07
 http://opencsw.org/bugtrack/view.php?id=3730#c6344 
---------------------------------------------------------------------- 
The restart function looks like it would still be broken, but that seems
like it will work.

Now that I look at things closer, I would almost consider treating a
configuration file without a pid_file declared to be an error on Solaris 10
and higher because pgrep will find multiple pids if it is run in the global
zone and there are non-global zones running nrpe as well. As it currently
stands, the script will attempt to kill all of them if it is run without a
pidfile.

You might also want to replace lines 32 and 33 with:

pidfile=`awk -F'=' '/^[ \t]*pid_file/ {print $2}' $CONFIG_FILE`
NRPE_USER=`awk -F'=' '/^[ \t]*nrpe_user/ { print $2 }' $CONFIG_FILE`

This fixes a couple of problems with spaces at the beginning of the line
for both config options and commented out pid_file lines




More information about the bug-notifications mailing list