diff options
author | Rong-En Fan <rafan@FreeBSD.org> | 2007-07-27 11:59:28 +0000 |
---|---|---|
committer | Rong-En Fan <rafan@FreeBSD.org> | 2007-07-27 11:59:28 +0000 |
commit | 15ecf7b00d85339c4ed0a32a947ce9c5623c30b0 (patch) | |
tree | fe7f855bd7e26a6666bcc61d9597355fb596f472 /net-mgmt | |
parent | - Correctly fix configure script and setup.sh breakage (diff) |
- Convert to rc.d style script
- Bump PORTREVISION
Note that I changed few places of the patch to match Porter's Handbook.
PR: ports/114952
Submitted by: Chris Cowart <ccowart at rescomp.berkeley.edu>
Notes
Notes:
svn path=/head/; revision=196384
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/net-snmp4/Makefile | 8 | ||||
-rw-r--r-- | net-mgmt/net-snmp4/files/snmpd.in | 26 | ||||
-rw-r--r-- | net-mgmt/net-snmp4/files/snmpd.sh.sample | 20 | ||||
-rw-r--r-- | net-mgmt/net-snmp4/pkg-plist | 1 |
4 files changed, 28 insertions, 27 deletions
diff --git a/net-mgmt/net-snmp4/Makefile b/net-mgmt/net-snmp4/Makefile index fd49f6b72943..1346819dd183 100644 --- a/net-mgmt/net-snmp4/Makefile +++ b/net-mgmt/net-snmp4/Makefile @@ -7,7 +7,7 @@ PORTNAME= ucd-snmp PORTVERSION= 4.2.6 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net-mgmt ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= net-snmp @@ -82,7 +82,7 @@ BIN= snmpbulkwalk snmpget snmpgetnext snmpnetstat snmpset \ snmpstatus snmptest snmptranslate snmptrap snmpwalk SBIN= snmpd snmptrapd -STARTUP_FILE= ${PREFIX}/etc/rc.d/snmpd.sh +USE_RC_SUBR= snmpd CONFLICTS= net-snmp-5.* @@ -134,9 +134,5 @@ post-install: @${MKDIR} ${PREFIX}/share/examples/ucd-snmp @for F in ${WRKSRC}/EXAMPLE.conf ${WRKSRC}/agent/mibgroup/examples/ucdDemoPublic.conf; do \ ${INSTALL_DATA} $$F ${PREFIX}/share/examples/ucd-snmp ; done - @if [ ! -f ${STARTUP_FILE} ]; then \ - ${ECHO} "Creating ${PREFIX}/etc/rc.d/snmpd.sh startup file."; \ - ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/snmpd.sh.sample ${STARTUP_FILE}; \ - fi .include <bsd.port.post.mk> diff --git a/net-mgmt/net-snmp4/files/snmpd.in b/net-mgmt/net-snmp4/files/snmpd.in new file mode 100644 index 000000000000..e4fe665431dc --- /dev/null +++ b/net-mgmt/net-snmp4/files/snmpd.in @@ -0,0 +1,26 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: snmpd +# REQUIRE: DAEMON +# +# Add the following lines to /etc/rc.conf to enable this service: +# +# snmpd_enable (bool): Set to NO by default. Set it to YES to enable snmpd. +# + +. %%RC_SUBR%% + +name=snmpd +rcvar=`set_rcvar` + +command=/usr/local/sbin/${name} +pidfile=/var/run/${name}.pid + +load_rc_config ${name} + +: ${snmpd_enable="NO"} +: ${snmpd_flags="-P /var/run/${name}.pid"} + +run_rc_command "$1" diff --git a/net-mgmt/net-snmp4/files/snmpd.sh.sample b/net-mgmt/net-snmp4/files/snmpd.sh.sample deleted file mode 100644 index 71f8b504ce81..000000000000 --- a/net-mgmt/net-snmp4/files/snmpd.sh.sample +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - [ -x ${PREFIX}/sbin/snmpd ] && ${PREFIX}/sbin/snmpd && echo -n ' snmpd' - ;; -stop) - killall snmpd && echo -n ' snmpd' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/net-mgmt/net-snmp4/pkg-plist b/net-mgmt/net-snmp4/pkg-plist index 439aeabe77b3..e3c7a8ce4b7c 100644 --- a/net-mgmt/net-snmp4/pkg-plist +++ b/net-mgmt/net-snmp4/pkg-plist @@ -19,7 +19,6 @@ bin/snmptrap bin/snmpusm bin/snmpvacm bin/snmpwalk -etc/rc.d/snmpd.sh include/ucd-snmp/agent_index.h include/ucd-snmp/agent_read_config.h include/ucd-snmp/agent_registry.h |