OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003764 [cswclassutils] packaging minor always 2009-07-10 21:53 2009-08-12 11:29
Reporter gadavis View Status public  
Assigned To bonivart
Priority normal Resolution fixed  
Status closed  
Summary 0003764: Problems with service manifest generation and buggy stop methods
Description I've noticed some issues with the NRPE package which I think might actually be a bug with either cswclassutils or mgar, with regards to the service manifests. When trying to install a package from the global zone on a zone that is in the halted state, the package installation errors out. The gory details are in bug 0003730 for NRPE.

I've also noticed that if a buggy start/stop script fails to actually stop the daemon in question that the system will hang on shutdown due to the method script timeout values all being set to 18446744073709551615.

This isn't the first time that I've had a package with a bad stop method hang the system on shutdown. I'd like to propose a couple of mitigating strategies:

* Set the method script timeout values to something reasonable so that SMF can complain about the bug in the stop method script properly

* Allow a package to specify in it's GAR Makefile that the stop method should be ":kill" rather than "/path/to/init/script stop". Obviously some packages will need to do a bit more cleanup than just killing a process. However, for simple daemons like nrpe letting SMF handle the process termination with ":kill" seems like it will suffice. I see that a package can provide it's own custom written service manifest in GAR, but it seems like overkill in simple cases like NRPE.
Additional Information Here's some output from the NRPE installation (copied from CSWnrpe bug 0003730)

# zoneadm list -cv
  ID NAME STATUS PATH BRAND IP
   0 global running / native shared
   1 anfweb-dev running /zones/anfweb-dev native shared
   - anfwfproc installed /zones/anfwfproc native shared

# pkgadd -d nrpe-2.12\,REV\=2009.06.30-SunOS5.8-sparc-CSW.pkg all
## Verifying package <CSWnrpe> dependencies in zone <anfweb-dev>
## Booting non-running zone <anfwfproc> into administrative state
## Verifying package <CSWnrpe> dependencies in zone <anfwfproc>
## Restoring state of global zone <anfwfproc>

The package <CSWnrpe> contains scripts which will be executed on
zones <anfwfproc, anfweb-dev> with super-user permission during the
process of installing this package.

Do you want to continue with the installation of <CSWnrpe> [y,n,?] y

Processing package instance <CSWnrpe> from </root/nrpe-2.12,REV=2009.06.30-SunOS5.8-sparc-CSW.pkg>
## Installing package <CSWnrpe> in global zone

nrpe - nagios remote plugin executor(sparc) 2.12,REV=2009.06.30
http://downloads.sourceforge.net/nagios/ [^] [^] packaged for CSW by Juergen Arndt
## Executing checkinstall script.
nagios user detected
nagios group detected
## Processing package information.
## Processing system information.
   2 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <CSWnrpe> [y,n,?] y

Installing nrpe - nagios remote plugin executor as <CSWnrpe>

## Executing preinstall script.
## Installing part 1 of 1.
/opt/csw/bin/nrpe <symbolic link>
/opt/csw/bin/nrpe_1k
/opt/csw/bin/nrpe_8k
/opt/csw/share/doc/nrpe/LEGAL
/opt/csw/share/doc/nrpe/NRPE.pdf
/opt/csw/share/doc/nrpe/README
/opt/csw/share/doc/nrpe/README.SSL
/opt/csw/share/doc/nrpe/README_8k
/opt/csw/share/doc/nrpe/SECURITY
[ verifying class <none> ]
Restoring /etc/opt/csw/preserve/CSWnrpe/nrpe.cfg

[ verifying class <cswpreserveconf> ]
Installing class <cswinitsmf> ...
Creating /var/opt/csw/svc/manifest/application ...
Creating service script in /var/opt/csw/svc/method/svc-cswnrpe ...
Creating manifest ...
Configuring service in SMF ...
CSWnrpe is using Service Management Facility. The FMRI is svc:/application/cswnrpe:default
[ verifying class <cswinitsmf> ]

Installation of <CSWnrpe> was successful.
## Installing package <CSWnrpe> in zone <anfweb-dev>

nrpe - nagios remote plugin executor(sparc) 2.12,REV=2009.06.30
## Executing checkinstall script.
nagios user detected
nagios group detected
## Processing package information.
## Processing system information.
   2 package pathnames are already properly installed.

Installing nrpe - nagios remote plugin executor as <CSWnrpe>

## Executing preinstall script.
## Installing part 1 of 1.
/opt/csw/bin/nrpe <symbolic link>
/opt/csw/bin/nrpe_1k
/opt/csw/bin/nrpe_8k
/opt/csw/share/doc/nrpe/LEGAL
/opt/csw/share/doc/nrpe/NRPE.pdf
/opt/csw/share/doc/nrpe/README
/opt/csw/share/doc/nrpe/README.SSL
/opt/csw/share/doc/nrpe/README_8k
/opt/csw/share/doc/nrpe/SECURITY
[ verifying class <none> ]
Copying sample config to /opt/csw/etc/nrpe.cfg

[ verifying class <cswpreserveconf> ]
Installing class <cswinitsmf> ...
Creating service script in /var/opt/csw/svc/method/svc-cswnrpe ...
Creating manifest ...
Configuring service in SMF ...
CSWnrpe is using Service Management Facility. The FMRI is svc:/application/cswnrpe:default
[ verifying class <cswinitsmf> ]

Installation of <CSWnrpe> on zone <anfweb-dev> was successful.
## Booting non-running zone <anfwfproc> into administrative state
## Installing package <CSWnrpe> in zone <anfwfproc>

nrpe - nagios remote plugin executor(sparc) 2.12,REV=2009.06.30
## Executing checkinstall script.
nagios user detected
nagios group detected
/var/tmp//installM_aiEa/checkinstallR_aiEa: /tmp/sh2470: cannot create
pkginstall: ERROR: checkinstall script did not complete successfully

Installation of <CSWnrpe> on zone <anfwfproc> failed.
No changes were made to the system.
## Restoring state of global zone <anfwfproc>
# svccfg -s cswnrpe listprop start/timeout_seconds
start/timeout_seconds count 18446744073709551615
# svccfg -s cswnrpe listprop stop/timeout_seconds
stop/timeout_seconds count 18446744073709551615
# svccfg -s cswnrpe listprop restart/timeout_seconds
restart/timeout_seconds count 18446744073709551615
Tags No tags attached.
Attached Files

- Relationships
related to 0003730closedja nrpe svcadm disable cswnrpe does not gracefully handle missing pid_file param, hangs system on shutdown 

-  Notes
(0006431)
gadavis (reporter)
2009-07-13 19:27
edited on: 2009-07-13 19:28

http://sourceforge.net/apps/trac/gar/browser/csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf [^] tries to use -1 as the timeout value for all of the method scripts. I think that 18446744073709551615 is what happens when you printf a signed 64-bit integer as an unsigned 64-bit integer. According to smf_method(5) (see http://docs.sun.com/app/docs/doc/816-5175/smf-method-5?a=view [^] ), timeout values of -1 are deprecated, and timeout values of 0 or -1 are not recommended.

Can the default timeout be set to something more reasonable like 120 seconds? Since individual services can provide their own manifests if they need to, those services that take longer than 2 minutes to shutdown can specify this in their custom manifests.

(0006513)
bonivart (developer)
2009-08-05 17:31

I have set new values after looking at what Sun uses for Sendmail. It will be in the next release.
(0006560)
bonivart (developer)
2009-08-12 11:29

Cswclassutils 1.18 released with fix.


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker