Subject: pkg/20605: rc.d scripts for net/ucd-snmp are not conform
To: None <gnats-bugs@gnats.netbsd.org>
From: David Ferlier <david@netbsd-fr.org>
List: netbsd-bugs
Date: 03/06/2003 23:51:29
>Number:         20605
>Category:       pkg
>Synopsis:       rc.d scripts for net/ucd-snmp are not conform
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 06 14:54:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Ferlier
>Release:        NetBSD 1.6
>Organization:
>Environment:
System: NetBSD hell 1.6 NetBSD 1.6 (CATAPULT) #0: Sat Dec 14 20:38:30 CET 2002 root@hell:/usr/src/sys/arch/i386/compile/CATAPULT i386
>Description:

The snmpd.sh and snmptrapd.sh scripts for net/ucd-snmp don't conform
to the rc.d system.

- There are no REQUIRE and PROVIDE lines.
- They don't use the syntax and variables of a rc.d script (name, rcvar,
command, pidfile ..)

The script ca be left be as it is now for the second point (no use
of rc.d variables). But for the first point, that's a big problem since these
scripts will be run first at system boot, and since / is still read-only, they
fail starting.

The attached patch fixes the problem.

>How-To-Repeat:
Install net/ucd-snmp and add snmpd=YES and snmptrapd=YES in rc.conf.
Observe they start first on boot, and that they miserably fail.

>Fix:

Index: pkgsrc/net/ucd-snmp/files/snmpd.sh
===================================================================
RCS file: /cvsroot/pkgsrc/net/ucd-snmp/files/snmpd.sh,v
retrieving revision 1.7
diff -b -u -r1.7 snmpd.sh
--- pkgsrc/net/ucd-snmp/files/snmpd.sh	2002/09/23 15:21:40	1.7
+++ pkgsrc/net/ucd-snmp/files/snmpd.sh	2003/03/06 22:50:13
@@ -2,6 +2,9 @@
 #
 # $NetBSD: snmpd.sh,v 1.7 2002/09/23 15:21:40 grant Exp $
 #
+# PROVIDE: snmpd
+# REQUIRE: DAEMON LOGIN network
+
 # PID file:
 PF=/var/run/snmpd.pid
 
Index: pkgsrc/net/ucd-snmp/files/snmptrapd.sh
===================================================================
RCS file: /cvsroot/pkgsrc/net/ucd-snmp/files/snmptrapd.sh,v
retrieving revision 1.5
diff -b -u -r1.5 snmptrapd.sh
--- pkgsrc/net/ucd-snmp/files/snmptrapd.sh	2002/09/23 15:21:40	1.5
+++ pkgsrc/net/ucd-snmp/files/snmptrapd.sh	2003/03/06 22:50:14
@@ -2,6 +2,9 @@
 #
 # $NetBSD: snmptrapd.sh,v 1.5 2002/09/23 15:21:40 grant Exp $
 #
+# PROVIDE: snmptrapd
+# REQUIRE: DAEMON LOGIN network
+
 # PID file:
 PF=/var/run/snmptrapd.pid
 
>Release-Note:
>Audit-Trail:
>Unformatted: