ports/104906: net-mgmt/nsca -- fix rc script

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Oct 29 13:50:32 UTC 2006


>Number:         104906
>Category:       ports
>Synopsis:       net-mgmt/nsca -- fix rc script
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 29 13:50:24 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Seaman
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
Infracaninophile
>Environment:
System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #12: Sun Oct 8 14:05:53 BST 2006 root at happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386


	
>Description:

The /usr/local/etc/rc.d/nsca rc script is unusable as currently
supplied:

  * The ncsa command is installed as /usr/local/sbin/nsca not
    /usr/local/libexec/nagios/nsca

  * /var/spoo/nagios/nsca.lock does not contain a PID.  The
    default in version 2.6 seems to be to use /var/run/nsca.pid

  * Starting nsca as user nagios from the rc script prevents
    the process from chrooting.  nsca will chroot, change UID
    to nagios and drop privileges itself, if those things are
    set in the config file.

  * nsca will reload itself when sent a HUP signal.  

  * ncsa_flags get incorporated into the command line twice 


>How-To-Repeat:
	
>Fix:

	

--- nsca.diff begins here ---
diff -Nur /usr/ports/net-mgmt/nsca/files/nsca.sh.in nsca/files/nsca.sh.in
--- /usr/ports/net-mgmt/nsca/files/nsca.sh.in	Thu Sep 14 13:27:47 2006
+++ nsca/files/nsca.sh.in	Sun Oct 29 13:36:23 2006
@@ -12,10 +12,9 @@
 name="nsca"
 rcvar=`set_rcvar`
 
-command="%%PREFIX%%/libexec/nagios/nsca"
-pidfile="/var/spool/nagios/nsca.lock"
-nsca_user="nagios"
-extra_commands="restart"
+command="%%PREFIX%%/sbin/nsca"
+pidfile="/var/run/nsca.pid"
+extra_commands=reload
 
 nsca_enable=${nsca_enable:-"NO"}
 nsca_flags=${nsca_flags:-"--single"}
@@ -24,6 +23,6 @@
 load_rc_config "${name}"
 
 required_files="${nsca_configfile}"
-command_args="-c ${nsca_configfile} ${nsca_flags}"
+command_args="-c ${nsca_configfile}"
 
 run_rc_command "$1"
--- nsca.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list