SHA256
1
0
forked from pool/net-snmp

Accepting request 82014 from net-snmp:factory

Update to version 5.7.1-rc1, so we can ship 5.7.1-final with openSUSE 12.1.

OBS-URL: https://build.opensuse.org/request/show/82014
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-snmp?expand=0&rev=51
This commit is contained in:
Sascha Peilicke 2011-09-14 13:00:35 +00:00 committed by Git OBS Bridge
parent 84bb330957
commit f130029335
11 changed files with 195 additions and 109 deletions

41
README.SUSE Normal file
View File

@ -0,0 +1,41 @@
An SNMP agent is a powerful and complex software and, as such, may
be affected by flaws and security issues. We recommend that SNMP
access (161/udp,162/udp) be blocked at your firewall.
There are also some important changes that have been made in this release
of our package:
o the daemon now sets a PID file in /var/run/
o logging is now done directly to /var/log/net-snmpd.log instead
of sending stderr/stdout through syslog.
o the daemon is now started with the '-r'. This option prevents
snmpd from exiting if it doesn't have permission to read something.
This only occurs if you start snmpd on a high port as a non-root
root user.
o If you need to run snmptrapd, we've provided an init script
in /etc/init.d/snmptrapd, but the service is disabled by default.
SNMP traps should be avoided whenever possible because they are
unreliable (you should poll with snmpget instead) and snmptrapd
has been the source of many of the security problems with SNMP
so please don't run this unless you are sure of what you are doing.
To enable the service, run
chkconfig snmptrapd on
and create a configuration file named /etc/snmp/snmptrapd.conf.
Then, start the daemon with
rcsnmptrapd start
Logging is done to /var/log/net-snmpd.log.
For more information see the manpages for snmptrapd and snmptrapd.conf.
o Master AgentX support is enabled if you have modules in
/usr/lib/net-snmp/agents. The domain socket is created as
/var/run/agentx/master. You can change this to a network
interface if needed (see snmpd(1)). The snmpd init script
automatically detects and starts any sub-agents in placed into
/var/lib/net-snmp.
More documentation on the net-snmp package can be found in this directory
as well as the project's homepage: http://www.net-snmp.org/

View File

@ -1,47 +0,0 @@
Our net-snmp package was audited by Thomas Biege of the SuSE Security team
prior to the release of CERT Advisory CA-2002-03. Of course, this
is not a guarantee that future problems will not be found and does not
address flaws and insecurities inherent in software as powerful and
complex as an SNMP implementation. Because of this we recommend that
SNMP access (161/udp,162/udp) be blocked at your firewall.
There are also some important changes that have been made in this release
of our package:
o the daemon now sets a PID file in /var/run/
o logging is now done directly to /var/log/net-snmp.log instead
of sending stderr/stdout through syslog. If you don't want logging,
remove the '-l /var/log/net-snmp.log' from /etc/init.d/snmpd.
o the daemon is now started with the '-r'. This option prevents
snmpd from exiting if it doesn't have permission to read something.
This only occurs if you start snmpd on a high port as a non-root
root user.
o If you need to run snmptrapd, we've provided an example init
script in /usr/share/doc/packages/net-snmp/rc.snmptrapd. SNMP
traps should be avoided whenever possible because they are
unreliable (you should poll with snmpget instead) and snmptrapd
has been the source of many of the security problems with snmp
so please don't run this unless you are sure of what you are doing.
To install the script,
install rc.snmptrapd /etc/init.d/snmptrapd
chkconfig snmptrapd on
ln -s ../../etc/init.d/snmptrapd /usr/sbin/rcsnmptrapd.
and create a configuration file named /etc/snmp/snmptrapd.conf. Then,
start the daemon with
rcsnmptrapd start
Logging is done to /var/log/net-snmptrapd.log.
For more informations see the manpages for snmptrapd and snmptrapd.conf.
o Master agentx support is enabled if you have modules in
/usr/lib/net-snmp/--the domain socket is created as
/var/run/agentx/master. You can change this to a network
interface if needed (see snmpd(1)). The snmpd init script
automatically detects and starts any sub-agents in placed into
/var/lib/net-snmp.
More documentation on the net-snmp package can be found in this directory
as well as the project's homepage: http://www.net-snmp.org/

View File

@ -1,4 +1,4 @@
libsnmp25
libsnmp30
arch ppc package net-snmp-devel
requires -net-snmp-<targettype>
requires "libsnmp25-<targettype> = <version>"
requires "libsnmp30-<targettype> = <version>"

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81982968d858af60f94864694fec752e2cc4d0d2f17fa62f22998429a50dc7f3
size 761

View File

@ -0,0 +1,52 @@
From: Mendel Mobach <mendel@mobach.nl>
Add ReiserFS to the list of recognized file systems and move
JFS and XFS defines below the right comment.
---
agent/mibgroup/hardware/fsys/fsys_mntent.c | 1 +
agent/mibgroup/hardware/fsys/mnttypes.h | 13 ++++++-------
2 files changed, 7 insertions(+), 7 deletions(-)
Index: net-snmp-5.7/agent/mibgroup/hardware/fsys/fsys_mntent.c
===================================================================
--- net-snmp-5.7.orig/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ net-snmp-5.7/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -135,6 +135,7 @@ _fsys_type( char *typename )
!strcmp(typename, MNTTYPE_GFS2) ||
!strcmp(typename, MNTTYPE_XFS) ||
!strcmp(typename, MNTTYPE_JFS) ||
+ !strcmp(typename, MNTTYPE_REISERFS) ||
!strcmp(typename, MNTTYPE_LOFS))
return NETSNMP_FS_TYPE_OTHER;
Index: net-snmp-5.7/agent/mibgroup/hardware/fsys/mnttypes.h
===================================================================
--- net-snmp-5.7.orig/agent/mibgroup/hardware/fsys/mnttypes.h
+++ net-snmp-5.7/agent/mibgroup/hardware/fsys/mnttypes.h
@@ -114,6 +114,12 @@
#ifndef MNTTYPE_GFS2
#define MNTTYPE_GFS2 "gfs2"
#endif
+#ifndef MNTTYPE_XFS
+#define MNTTYPE_XFS "xfs"
+#endif
+#ifndef MNTTYPE_JFS
+#define MNTTYPE_JFS "jfs"
+#endif
/*
* File systems to monitor, but not covered by HR-TYPES enumerations
@@ -156,12 +162,5 @@
#ifndef MNTTYPE_RPCPIPE
#define MNTTYPE_RPCPIPE "rpc_pipefs"
#endif
-#ifndef MNTTYPE_XFS
-#define MNTTYPE_XFS "xfs"
-#endif
-#ifndef MNTTYPE_JFS
-#define MNTTYPE_JFS "jfs"
-#endif
-
#endif /* _NETSNMP_FSYS_MNTTYPES_H */

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:697fca5463332adeb377f02e922d6ac82b4275b9d7f4eb9bea05d61702117916
size 4378578

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3f3a1672f532669bf2e0e9e5b0b2f31b5d46cd7798333edd1554ba5a0054b748
size 4362642

View File

@ -1,10 +1,48 @@
-------------------------------------------------------------------
Thu Jul 14 17:46:57 UTC 2011 - lchiquitto@novell.com
Fri Sep 9 20:41:31 UTC 2011 - lchiquitto@suse.com
- update to version 5.7.1.rc1 but keep package version as 5.7.1
to avoid update problems when the final version is released
-------------------------------------------------------------------
Fri Sep 9 20:18:31 UTC 2011 - lchiquitto@suse.com
- small fixes to snmpd and snmptrapd init scripts:
- if $SNMPD_LOGLEVEL is not defined, use LOG_NOTICE instead of
LOG_DEBUG
- improve messages printed and service description
- write snmptrapd logs to /var/log/net-snmpd.log
-------------------------------------------------------------------
Fri Sep 9 19:36:55 UTC 2011 - lchiquitto@suse.com
- update README.SUSE to reflect some recent changes and drop a bit
of outdated information
- update baselibs to reflect new library version
- spec file cleanup: rename some source files for consistency
-------------------------------------------------------------------
Thu Sep 1 12:48:57 UTC 2011 - lchiquitto@suse.com
- add ReiserFS to the list of known file systems (bnc#715199)
-------------------------------------------------------------------
Tue Aug 30 01:43:26 UTC 2011 - lchiquitto@suse.com
- install snmptrapd init script by default (bnc#712175)
-------------------------------------------------------------------
Tue Aug 30 01:37:28 UTC 2011 - lchiquitto@suse.com
- fix logging option in snmptrapd init script (bnc#712174)
-------------------------------------------------------------------
Thu Jul 14 17:46:57 UTC 2011 - lchiquitto@suse.com
- update upstream patches from branch V5-7-patches to 20110714
-------------------------------------------------------------------
Tue Jul 5 12:28:00 UTC 2011 - lchiquitto@novell.com
Tue Jul 5 12:28:00 UTC 2011 - lchiquitto@suse.com
- update to version 5.7:
new features and lots of bug fixes
@ -22,27 +60,27 @@ Thu May 19 14:43:13 CEST 2011 - mls@suse.de
- switch from rpmdb to rpmts to support rpm-4.9.0
-------------------------------------------------------------------
Thu May 12 14:49:34 UTC 2011 - lchiquitto@novell.com
Thu May 12 14:49:34 UTC 2011 - lchiquitto@suse.com
- update upstream patches from branch V5-6-patches to 20110512
-------------------------------------------------------------------
Wed Apr 13 17:30:28 UTC 2011 - lchiquitto@novell.com
Wed Apr 13 17:30:28 UTC 2011 - lchiquitto@suse.com
- add JFS and XFS to the list of known file systems (bnc#687327)
-------------------------------------------------------------------
Mon Mar 28 18:53:16 UTC 2011 - lchiquitto@novell.com
Mon Mar 28 18:53:16 UTC 2011 - lchiquitto@suse.com
- update upstream patches from branch V5-6-patches to 20110328
-------------------------------------------------------------------
Tue Jan 4 11:34:19 UTC 2011 - lchiquitto@novell.com
Tue Jan 4 11:34:19 UTC 2011 - lchiquitto@suse.com
- fix libsnmp version in baselibs.conf
-------------------------------------------------------------------
Tue Jan 4 11:26:48 UTC 2011 - lchiquitto@novell.com
Tue Jan 4 11:26:48 UTC 2011 - lchiquitto@suse.com
- update to version 5.6.1:
new features and lots of bug fixes
@ -51,12 +89,12 @@ Tue Jan 4 11:26:48 UTC 2011 - lchiquitto@novell.com
net-snmp-5.6.0-ethtool-speed.patch
-------------------------------------------------------------------
Tue Nov 30 18:09:58 UTC 2010 - lchiquitto@novell.com
Tue Nov 30 18:09:58 UTC 2010 - lchiquitto@suse.com
- remove /var/adm/perl-modules/net-snmp from the Perl module
-------------------------------------------------------------------
Mon Nov 29 10:43:34 UTC 2010 - lchiquitto@novell.com
Mon Nov 29 10:43:34 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-6-patches to 20101129
- spec file cleanup: upstream uses -fno-strict-aliasing by default
@ -66,29 +104,29 @@ Mon Nov 29 10:43:34 UTC 2010 - lchiquitto@novell.com
net-snmp-5.6.0-vendorperl.patch
-------------------------------------------------------------------
Wed Nov 3 12:04:50 UTC 2010 - lchiquitto@novell.com
Wed Nov 3 12:04:50 UTC 2010 - lchiquitto@suse.com
- if-mib: add support for more speeds with ethtool (bnc#650558)
-------------------------------------------------------------------
Mon Nov 1 17:54:34 UTC 2010 - lchiquitto@novell.com
Mon Nov 1 17:54:34 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-6-patches to 20101101,
fixing a segmentation fault on shutdown (bnc#650282)
-------------------------------------------------------------------
Wed Oct 27 16:48:40 UTC 2010 - lchiquitto@novell.com
Wed Oct 27 16:48:40 UTC 2010 - lchiquitto@suse.com
- enable new implementation of hrStorage and hrFilesys to fix
persistent indexes in FS and Storage tables (bnc#648364)
-------------------------------------------------------------------
Thu Oct 21 14:37:36 UTC 2010 - lchiquitto@novell.com
Thu Oct 21 14:37:36 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-6-patches to 20101021
-------------------------------------------------------------------
Tue Oct 19 23:59:46 UTC 2010 - lchiquitto@novell.com
Tue Oct 19 23:59:46 UTC 2010 - lchiquitto@suse.com
- update to version 5.6:
new features and lots of bug fixes
@ -98,28 +136,28 @@ Tue Oct 19 23:59:46 UTC 2010 - lchiquitto@novell.com
net-snmp-5.6.0-net-snmp-config-headercheck.patch
-------------------------------------------------------------------
Tue Aug 3 18:33:33 UTC 2010 - lchiquitto@novell.com
Tue Aug 3 18:33:33 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-5-patches to 20100803
-------------------------------------------------------------------
Mon Jul 19 16:36:49 UTC 2010 - lchiquitto@novell.com
Mon Jul 19 16:36:49 UTC 2010 - lchiquitto@suse.com
- change default log level from DEBUG to NOTICE (bnc#623497)
-------------------------------------------------------------------
Fri Jul 16 01:04:14 UTC 2010 - lchiquitto@novell.com
Fri Jul 16 01:04:14 UTC 2010 - lchiquitto@suse.com
- spec file cleanup: remove old backward compatibility scripts
-------------------------------------------------------------------
Thu Jun 3 11:43:52 UTC 2010 - lchiquitto@novell.com
Thu Jun 3 11:43:52 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-5-patches to 20100602:
fixed potential buffer overflow in parsing OIDs in config files
-------------------------------------------------------------------
Mon May 31 13:48:27 UTC 2010 - lchiquitto@novell.com
Mon May 31 13:48:27 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-5-patches to 20100531
- add net-snmp-5.5.0-rpmdb-h-detect.patch:
@ -128,13 +166,13 @@ Mon May 31 13:48:27 UTC 2010 - lchiquitto@novell.com
net-snmp-5.5.0-use-lmsensors-v3.patch
-------------------------------------------------------------------
Fri Apr 30 16:01:08 UTC 2010 - lchiquitto@novell.com
Fri Apr 30 16:01:08 UTC 2010 - lchiquitto@suse.com
- create /var/run/agentx during startup to support systems that
mount /var/run as tmpfs
-------------------------------------------------------------------
Wed Apr 28 21:41:22 UTC 2010 - lchiquitto@novell.com
Wed Apr 28 21:41:22 UTC 2010 - lchiquitto@suse.com
- update libsnmp package name to reflect the library version we
are currently shipping
@ -146,12 +184,12 @@ Wed Apr 28 21:41:22 UTC 2010 - lchiquitto@novell.com
versions of the distribution
-------------------------------------------------------------------
Wed Apr 28 21:38:21 UTC 2010 - lchiquitto@novell.com
Wed Apr 28 21:38:21 UTC 2010 - lchiquitto@suse.com
- update upstream patches from branch V5-5-patches to 20100428
-------------------------------------------------------------------
Mon Apr 5 15:58:58 UTC 2010 - lchiquitto@novell.com
Mon Apr 5 15:58:58 UTC 2010 - lchiquitto@suse.com
- add net-snmp-5.5.0_upstream-20100405.patch:
merge all patches committed to upstream branch V5-5-patches
@ -163,7 +201,7 @@ Mon Apr 5 15:58:58 UTC 2010 - lchiquitto@novell.com
net-snmp-5.5.0_gcc45.patch
-------------------------------------------------------------------
Fri Mar 5 17:33:34 UTC 2010 - lchiquitto@novell.com
Fri Mar 5 17:33:34 UTC 2010 - lchiquitto@suse.com
- Fix strncat properly (from Andreas Jaeger)
@ -183,7 +221,7 @@ Mon Feb 1 12:06:49 UTC 2010 - jengelh@medozas.de
- remove sparcv9-specific baselib exceptions (not needed)
-------------------------------------------------------------------
Tue Jan 19 12:01:54 UTC 2010 - lchiquitto@novell.com
Tue Jan 19 12:01:54 UTC 2010 - lchiquitto@suse.com
- remove net-snmp-5.4.1.2-rmon-mib-revised_3.patch from sources
(upstream since 5.5)
@ -191,7 +229,7 @@ Tue Jan 19 12:01:54 UTC 2010 - lchiquitto@novell.com
- spec file cleanup: update package description
-------------------------------------------------------------------
Tue Dec 22 09:41:44 UTC 2009 - lchiquitto@novell.com
Tue Dec 22 09:41:44 UTC 2009 - lchiquitto@suse.com
- update to version 5.5:
new features and lots of bug fixes, including:

View File

@ -27,7 +27,7 @@
%define netsnmp_agentx_socket_dir_rfc /var/agentx
Name: net-snmp
Version: 5.7
Version: 5.7.1
Release: 1
License: BSD3c(or similar) ; MIT License (or similar)
Group: Productivity/Networking/Other
@ -45,25 +45,23 @@ Obsoletes: net-snmp-64bit
%endif
#
Url: http://sourceforge.net/projects/net-snmp
Source: %{pkg_name}-%{version}.tar.bz2
Source1: rc.net-snmp
Source: %{pkg_name}-%{version}.rc1.tar.bz2
Source1: rc.snmpd
Source2: snmpd.conf
Source3: README.SuSE
Source3: README.SUSE
Source4: rc.snmptrapd
Source5: net-snmp.logrotate
Source6: test_installed
Source7: net-snmp.sysconfig
Source8: net-snmp-rpmlintrc
Source9: baselibs.conf
%define patchdate 20110714
Patch0: net-snmp-%{version}-upstream-%{patchdate}.patch.bz2
# unused patch atm
Patch1: net-snmp-5.5.0-socket-path.patch
Patch2: net-snmp-5.5.0-testing-empty-arptable.patch
Patch3: net-snmp-5.7.0-pie.patch
Patch5: net-snmp-5.6.1-net-snmp-config-headercheck.patch
Patch6: net-snmp-5.5.0-perl-tk-warning.patch
Patch7: net-snmp-5.7.0-velocity-mib.patch
Patch8: net-snmp-5.7.0-recognize-reiserfs.patch
#
Summary: SNMP Daemon
@ -197,14 +195,14 @@ Authors:
G.S. Marzot <gmarzot@nortelnetworks.com>
%prep
%setup -q -n %{pkg_name}-%{version}
%patch0 -p1
%setup -q -n %{pkg_name}-%{version}.rc1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \
@ -251,12 +249,14 @@ LD_RUN_PATH="$PWD/snmplib/.libs" LD_LIBRARY_PATH="${PWD}/snmplib/.libs:${PWD}/ag
%makeinstall INSTALL_PREFIX=%{buildroot}
%{__install} -Dd %{buildroot}/var/log %{buildroot}/var/lib/net-snmp %{buildroot}/usr/lib/net-snmp/agents %{buildroot}%{netsnmp_agentx_socket_dir_fhs}
%{__install} -D -m 0755 %{SOURCE1} %{buildroot}/etc/init.d/snmpd
%{__install} -D -m 0755 %{SOURCE4} %{buildroot}/etc/init.d/snmptrapd
%{__install} -D -m 0600 %{SOURCE2} %{buildroot}/etc/snmp/snmpd.conf
%{__install} -m 0644 %{SOURCE3} .
%{__install} -m 0644 %{SOURCE4} .
%{__install} -D -m 0644 %{SOURCE5} %{buildroot}/etc/logrotate.d/net-snmp
%{__install} -m 0744 %{SOURCE6} testing/
%{__ln_s} -f /etc/init.d/snmpd %{buildroot}%{_sbindir}/rcsnmpd
%{__ln_s} -f /etc/init.d/snmptrapd %{buildroot}%{_sbindir}/rcsnmptrapd
%{__install} -m 0644 /dev/null %{buildroot}%{netsnmp_logfile}
pushd perl
%perl_make_install
@ -284,6 +284,7 @@ popd
%postun
%restart_on_update snmpd
%restart_on_update snmptrapd
%{insserv_cleanup}
%post -n %{library_name} -p /sbin/ldconfig
@ -293,11 +294,12 @@ popd
%files
%defattr(-,root,root)
%doc AGENT.txt COPYING EXAMPLE.conf EXAMPLE.conf.def
%doc FAQ NEWS TODO rc.snmptrapd
%doc FAQ NEWS TODO
%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 README.thread
%dir /etc/snmp
%config(noreplace) /etc/snmp/snmpd.conf
%config /etc/init.d/snmpd
%config /etc/init.d/snmptrapd
%{_bindir}/encode_keychange
%{_bindir}/fixproc
%{_bindir}/ipf-mod.pl

View File

@ -1,7 +1,7 @@
#! /bin/sh
# Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany. All rights reserved.
# Copyright (c) 1996-2011 SuSE GmbH Nuernberg, Germany. All rights reserved.
#
# Author: Christopher Mahmood <ckm+snmp@suse.de>, Remo Behn <ray+snmp@suse.de>
# Author: Christopher Mahmood, Remo Behn
#
# /etc/init.d/snmpd
#
@ -13,13 +13,14 @@
# Should-Stop: $syslog $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Net-SNMP snmpd
# Short-Description: Net-SNMP snmpd
# Description: Net-SNMP agent
# Short-Description: Net-SNMP agent
### END INIT INFO
SNMPD=/usr/sbin/snmpd
AGENTDIR=/usr/lib/net-snmp/agents
SNMPDCONF=/etc/snmp/snmpd.conf
SNMPD_PID=/var/run/snmpd.pid
test -x $SNMPD || exit 5
@ -86,12 +87,12 @@ case "$1" in
SNMPD_SIZE_LOGFILE="$(stat -c "%s" $SNMPD_LOGFILE)"
SNMPD_SIZE_MAX="1073741824"
if [ $SNMPD_SIZE_LOGFILE -gt $SNMPD_SIZE_MAX ] ; then
echo -e "\n\"$SNMPD_LOGFILE\" was to large. Running 'logrotate' for net-snmp." >&2
echo -e "\n\"$SNMPD_LOGFILE\" is too large. Running 'logrotate' for net-snmp." >&2
/usr/sbin/logrotate /etc/logrotate.d/net-snmp
fi # if [ $SNMPD_SIZE_LOGFILE -gt $SNMPD_SIZE_MAX ] ; then
fi # if [ -e "$SNMPD_LOGFILE" ] ; then
fi
fi
get_agents
# Do not add -c /etc/snmpd.conf, since it is already loaded by default.
# Don't add -c /etc/snmp/snmpd.conf, as it is loaded by default.
if [ $SNMPDCONF = "/etc/snmp/snmpd.conf" ]; then
SNMPDCONF=""
else
@ -111,7 +112,7 @@ case "$1" in
if [ ! -d /var/run/agentx ]; then
mkdir -m 0700 /var/run/agentx
fi
startproc $SNMPD $SNMPDCONF -r -A -LF ${SNMPD_LOGLEVEL:-d} $SNMPD_LOGFILE -p /var/run/snmpd.pid $agentargs $SNMPDNOSMUX $SNMPDNOTCPWRAPPERLOG
startproc $SNMPD $SNMPDCONF -r -A -LF ${SNMPD_LOGLEVEL:-n} $SNMPD_LOGFILE -p $SNMPD_PID $agentargs $SNMPDNOSMUX $SNMPDNOTCPWRAPPERLOG
rc_status -v
rc_reset

View File

@ -1,28 +1,30 @@
#! /bin/sh
# Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany. All rights reserved.
# Copyright (c) 1996-2011 SuSE GmbH Nuernberg, Germany. All rights reserved.
#
# Author: Christopher Mahmood <ckm@suse.de>, 2002
# Author: Christopher Mahmood
#
# /etc/init.d/snmptrapd
#
### BEGIN INIT INFO
# Provides: snmpdtrapd
# Provides: snmptrapd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: start net-snmptrapd
# Description: Receive and log SNMP trap messages
# Short-Description: Receive and log SNMP trap messages
### END INIT INFO
SNMPTRAPD=/usr/sbin/snmptrapd
SNMPTRAPD_CONF="/etc/snmp/snmptrapd.conf"
SNMPTRAPD_LOGFILE="/var/log/net-snmp.log"
SNMPTRAPD_LOGFILE="/var/log/net-snmpd.log"
SNMPTRAPD_PID="/var/run/snmptrapd.pid"
test -x $SNMPTRAPD || exit 5
# Check for existence of needed config file and read it
SNMPD_CONFIG=/etc/sysconfig/net-snmp
test -r $SNMPD_CONFIG || { echo "$SNMPD_CONFIG not existing";
test -r $SNMPD_CONFIG || { echo "$SNMPD_CONFIG doesn't exist.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
@ -52,7 +54,7 @@ rc_reset
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
@ -62,11 +64,11 @@ if [ $SNMPTRAPD_CONF = "/etc/snmp/snmptrapd.conf" ]; then
else
SNMPTRAPD_CONF="-c $SNMPTRAPD_CONF"
fi
SNMPTRAPD_LOGFILE="${SNMPTRAPD_LOGFILE:-/var/log/net-snmp.log}"
SNMPTRAPD_LOGFILE="${SNMPTRAPD_LOGFILE:-/var/log/net-snmpd.log}"
case "$1" in
start)
echo -n "Starting snmptrapd:"
startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -Lf ${SNMPD_LOGLEVEL:-d} $SNMPTRAPD_LOGFILE -p /var/run/snmptrapd.pid
startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -LF ${SNMPD_LOGLEVEL:-n} $SNMPTRAPD_LOGFILE -p $SNMPTRAPD_PID
rc_status -v
;;
stop)