Prepare the package for review and clean in, when looknig at it. This

includes lot of changes, including:
- remove tab characters, rpmlint does not like mix of tabs and spaces
- remove logrotate config, snmpd logs to syslog (/var/log/messages)
- remove ucd5820stat, it depends on ucd5820stat
- add sample net-snmptrapd.sysconfig and use /etc/sysconfig/snmptrapd
    instead of /etc/snmpd/*.options
- remove rpath from all executables and libraries
- compile some additional MIBs and OIDs
- simplify perl and python compilation
- convert documentation files to UTF-8 Resolves: #540799 Related: #226192
This commit is contained in:
Jan Šafránek 2009-11-25 15:22:55 +00:00
parent efe9a18fdc
commit 0ab722d645
3 changed files with 120 additions and 104 deletions

View File

@ -8,7 +8,7 @@
Summary: A collection of SNMP protocol tools and libraries Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp Name: net-snmp
Version: %{major_ver} Version: %{major_ver}
Release: 1%{?dist} Release: 2%{?dist}
Epoch: 1 Epoch: 1
License: BSD and MIT License: BSD and MIT
@ -18,12 +18,11 @@ Source0: http://dl.sourceforge.net/net-snmp/net-snmp-%{major_ver}.tar.gz
Source1: net-snmp.redhat.conf Source1: net-snmp.redhat.conf
Source2: net-snmpd.init Source2: net-snmpd.init
Source3: net-snmptrapd.init Source3: net-snmptrapd.init
Source4: net-snmpd.logrotate Source4: net-snmp-config.h
Source5: ucd5820stat Source5: net-snmp-config
Source6: net-snmp-config.h Source6: net-snmp-trapd.redhat.conf
Source7: net-snmp-config Source7: net-snmpd.sysconfig
Source8: net-snmp-trapd.redhat.conf Source8: net-snmptrapd.sysconfig
Source9: net-snmpd.sysconfig
Patch1: net-snmp-5.4.1-pie.patch Patch1: net-snmp-5.4.1-pie.patch
Patch2: net-snmp-5.5-dir-fix.patch Patch2: net-snmp-5.5-dir-fix.patch
Patch3: net-snmp-5.5-multilib.patch Patch3: net-snmp-5.5-multilib.patch
@ -43,6 +42,7 @@ BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel
BuildRequires: perl-devel, perl(ExtUtils::Embed), gawk, procps BuildRequires: perl-devel, perl(ExtUtils::Embed), gawk, procps
BuildRequires: python-devel, python-setuptools BuildRequires: python-devel, python-setuptools
BuildRequires: chrpath
%ifnarch s390 s390x %ifnarch s390 s390x
BuildRequires: lm_sensors-devel >= 3 BuildRequires: lm_sensors-devel >= 3
%endif %endif
@ -52,7 +52,6 @@ BuildRequires: tcp_wrappers-devel
BuildRequires: perl, coreutils, grep, sed, findutils BuildRequires: perl, coreutils, grep, sed, findutils
#%define __libtoolize /bin/true #%define __libtoolize /bin/true
%{expand: %%define _includedir %{_includedir}/%{name}}
%description %description
SNMP (Simple Network Management Protocol) is a protocol used for SNMP (Simple Network Management Protocol) is a protocol used for
@ -67,7 +66,7 @@ You will probably also want to install the net-snmp-utils package,
which contains NET-SNMP utilities. which contains NET-SNMP utilities.
Building option: Building option:
--without tcp_wrappers : disable tcp_wrappers support --without tcp_wrappers : disable tcp_wrappers support
%package utils %package utils
Group: Applications/System Group: Applications/System
@ -172,49 +171,54 @@ export LDFLAGS="-L%{_libdir}"
export LIBDIR="%{_libdir}" export LIBDIR="%{_libdir}"
MIBS="host agentx smux \ MIBS="host agentx smux \
ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
ip-mib/ipAddressPrefixTable/ipAddressPrefixTable" ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
sctp-mib rmon-mib etherlike-mib"
%ifnarch s390 s390x %ifnarch s390 s390x
MIBS="$MIBS ucd-snmp/lmsensorsMib" MIBS="$MIBS ucd-snmp/lmsensorsMib"
%endif %endif
%configure \ %configure \
--disable-static --enable-shared \ --disable-static --enable-shared \
--with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \ --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \
%ifnarch s390 s390x %ifnarch s390 s390x
--with-ldflags="$LDFLAGS -lcrypto -lsensors" \ --with-ldflags="$LDFLAGS -lcrypto -lsensors" \
%else %else
--with-ldflags="$LDFLAGS -lcrypto" \ --with-ldflags="$LDFLAGS -lcrypto" \
%endif %endif
--with-sys-location="Unknown" \ --with-sys-location="Unknown" \
--with-logfile="/var/log/snmpd.log" \ --with-logfile="/var/log/snmpd.log" \
--with-persistent-directory="/var/lib/net-snmp" \ --with-persistent-directory="/var/lib/net-snmp" \
--with-mib-modules="$MIBS" \ --with-mib-modules="$MIBS" \
%if %{tcp_wrappers} %if %{tcp_wrappers}
--with-libwrap=yes \ --with-libwrap=yes \
%endif %endif
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--enable-ipv6 \ --enable-ipv6 \
--enable-ucd-snmp-compatibility \ --enable-ucd-snmp-compatibility \
--with-openssl \ --with-openssl \
--with-pic \ --with-pic \
--enable-embedded-perl \ --enable-embedded-perl \
--enable-mfd-rewrites \ --enable-as-needed \
--enable-local-smux \ --with-perl-modules="INSTALLDIRS=vendor" \
--enable-mfd-rewrites \
--enable-local-smux \
--with-sys-contact="root@localhost" <<EOF --with-sys-contact="root@localhost" <<EOF
EOF EOF
make %{?_smp_mflags} # remove rpath from libtool
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
pushd perl # the package is not %_smp_mflags safe
# Use just built libs for perl module building, not the system libs. make
export NETSNMP_DONT_CHECK_VERSION=1
perl Makefile.PL -NET-SNMP-IN-SOURCE=true PREFIX=${RPM_BUILD_ROOT}/%{_prefix} INSTALLDIRS=vendor -NET-SNMP-CONFIG="sh ../../net-snmp-config" # remove rpath from perl libs
perl -pi -e 's/^LD_RUN_PATH.*//;s/LD_RUN_PATH=\".*\" //;' default_store/Makefile OID/Makefile agent/Makefile agent/default_store/Makefile ASN/Makefile SNMP/Makefile find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
make %{?smp_mflags}
popd
pushd python pushd python
# built python module building # built python module building
@ -223,24 +227,22 @@ popd
%install %install
rm -rf ${RPM_BUILD_ROOT} rm -rf ${RPM_BUILD_ROOT}
%makeinstall ucdincludedir=${RPM_BUILD_ROOT}/usr/include/ucd-snmp make install DESTDIR=${RPM_BUILD_ROOT}
# Determine which arch net-snmp-config.h is going to try to #include.
# Determine which arch opensslconf.h is going to try to #include.
basearch=%{_arch} basearch=%{_arch}
%ifarch %{ix86} %ifarch %{ix86}
basearch=i386 basearch=i386
%endif %endif
%ifarch %{multilib_arches} %ifarch %{multilib_arches}
# Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you # Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
# can have both a 32- and 64-bit version of the library, and they each need # can have both a 32- and 64-bit version of the library, and they each need
# their own correct-but-different versions of net-snmp-config.h to be usable. # their own correct-but-different versions of net-snmp-config.h to be usable.
mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch} mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config-${basearch}.h mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config-${basearch}.h
install -m644 %SOURCE6 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h install -m644 %SOURCE4 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h
%endif %endif
# remove .la files # remove .la files
@ -248,75 +250,79 @@ rm ${RPM_BUILD_ROOT}%{_libdir}/*.la
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf
install -m 644 %SOURCE8 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf install -m 644 %SOURCE6 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf
install -d ${RPM_BUILD_ROOT}%{_initrddir} install -d ${RPM_BUILD_ROOT}%{_initrddir}
install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_initrddir}/snmpd install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_initrddir}/snmpd
install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}%{_initrddir}/snmptrapd install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}%{_initrddir}/snmptrapd
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
install -m 644 %SOURCE9 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmpd install -m 644 %SOURCE7 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmpd
install -m 644 %SOURCE8 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmptrapd
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/snmpd
install -d ${RPM_BUILD_ROOT}%{_bindir}
install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}%{_bindir}/ucd5820stat
# prepare /var/lib/net-snmp
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp
# remove things we don't want to distribute
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/snmpconf.1*
ln -s snmptrap ${RPM_BUILD_ROOT}/usr/bin/snmpinform ln -s snmptrap ${RPM_BUILD_ROOT}/usr/bin/snmpinform
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
rm -f $RPM_BUILD_ROOT/%{_bindir}/fixproc
rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/fixproc*
rm -f $RPM_BUILD_ROOT/%{_bindir}/ipf-mod.pl
# remove docs that do not apply to Linux
rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32
# copy missing mib2c.conf files # copy missing mib2c.conf files
cp local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp install -m 644 local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp
# instal perl module
pushd perl pushd perl
make install_vendor
eval $(perl '-V:installvendorarch') eval $(perl '-V:installvendorarch')
# remove special files # remove special perl files
find $RPM_BUILD_ROOT -name perllocal.pod \ find $RPM_BUILD_ROOT -name perllocal.pod \
-o -name .packlist \ -o -name .packlist \
-o -name "*.bs" \ -o -name "*.bs" \
-o -name Makefile.subs.pl \ -o -name Makefile.subs.pl \
| xargs -ri rm -f {} | xargs -ri rm -f {}
# build files list # build perl files list
find $RPM_BUILD_ROOT/$installvendorarch -type f -print \ find $RPM_BUILD_ROOT/$installvendorarch -type f -print \
-o -type d -a -printf '%%%%dir %%p\n' \ -o -type d -a -printf '%%%%dir %%p\n' \
| sed "s@$RPM_BUILD_ROOT@@g" \ | sed "s@$RPM_BUILD_ROOT@@g" \
| grep -v "$installvendorarch\$" \ | grep -v "$installvendorarch\$" \
| grep -v '/auto$' \ | grep -v '/auto$' \
> ../perl.lst > ../perl.lst
popd popd
# install python module
pushd python pushd python
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__python} setup.py --basedir=.. install -O1 --skip-build --root $RPM_BUILD_ROOT
popd popd
find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755
# remove docs that do not apply to Linux
for file in "README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32"
do
rm $file
done
rm $RPM_BUILD_ROOT/%{_bindir}/fixproc
rm $RPM_BUILD_ROOT/%{_mandir}/man1/fixproc*
# trim down massive ChangeLog # trim down massive ChangeLog
dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
# convert files to UTF-8
for file in README COPYING; do
iconv -f 8859_1 -t UTF-8 <$file >$file.utf8
mv $file.utf8 $file
done
# remove executable bit from documentation samples
chmod 644 local/passtest local/ipf-mod.pl
%post %post
/sbin/chkconfig --add snmpd /sbin/chkconfig --add snmpd
/sbin/chkconfig --add snmptrapd /sbin/chkconfig --add snmptrapd
# move local state files from /var/net-snmp to new location when updating the package # move local state files from /var/net-snmp to new location when updating the package
mv %{_localstatedir}/net-snmp/* %{_localstatedir}/lib/net-snmp/ &>/dev/null || : /bin/mv %{_localstatedir}/net-snmp/* %{_localstatedir}/lib/net-snmp/ &>/dev/null || :
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -324,8 +330,6 @@ if [ $1 = 0 ]; then
/sbin/chkconfig --del snmpd /sbin/chkconfig --del snmpd
service snmptrapd stop >/dev/null 2>&1 service snmptrapd stop >/dev/null 2>&1
/sbin/chkconfig --del snmptrapd /sbin/chkconfig --del snmptrapd
# remove stale autogenerated file
rm -f %{_datadir}/snmp/mibs/.index
fi fi
%postun %postun
@ -343,26 +347,25 @@ rm -rf ${RPM_BUILD_ROOT}
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO %doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO
%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 %doc README README.agent-mibs README.agentx README.krb5 README.snmpv3
%doc local/passtest %doc local/passtest local/ipf-mod.pl
%doc README.thread AGENT.txt PORTING local/README.mib2c local/ipf-mod.pl %doc README.thread AGENT.txt PORTING local/README.mib2c
%{_initrddir}/snmpd %{_initrddir}/snmpd
%{_initrddir}/snmptrapd %{_initrddir}/snmptrapd
%config(noreplace) %{_sysconfdir}/logrotate.d/snmpd
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd %config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd
%dir %{_sysconfdir}/snmp %dir %{_sysconfdir}/snmp
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf %config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf %config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf
%{_bindir}/ucd5820stat
%{_bindir}/ipf-mod.pl
%{_bindir}/snmpconf %{_bindir}/snmpconf
%{_bindir}/net-snmp-create-v3-user %{_bindir}/net-snmp-create-v3-user
%{_sbindir}/* %{_sbindir}/*
%attr(0644,root,root) %{_mandir}/man[58]/snmp*d* %attr(0644,root,root) %{_mandir}/man[58]/snmp*d*
%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz %attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz
%attr(0644,root,root) %{_mandir}/man5/variables* %attr(0644,root,root) %{_mandir}/man5/variables*
%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user* %attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user*
%attr(0644,root,root) %{_mandir}/man1/snmpconf.1.gz
%dir %{_datadir}/snmp %dir %{_datadir}/snmp
%{_datadir}/snmp/snmpconf-data %{_datadir}/snmp/snmpconf-data
%dir %{_localstatedir}/lib/net-snmp %dir %{_localstatedir}/lib/net-snmp
@ -371,19 +374,19 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_bindir}/encode_keychange %{_bindir}/encode_keychange
%{_bindir}/snmp[^c]* %{_bindir}/snmp[^c]*
%attr(0644,root,root) %{_mandir}/man1/snmp*.1* %attr(0644,root,root) %{_mandir}/man1/snmp*.1*
%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1* %attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1*
%attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz %attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz
%attr(0644,root,root) %{_mandir}/man5/variables.5.gz %attr(0644,root,root) %{_mandir}/man5/variables.5.gz
%files devel %files devel
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%{_libdir}/lib*.so %{_libdir}/lib*.so
/usr/include/* /usr/include/*
%attr(0644,root,root) %{_mandir}/man3/*.3.* %attr(0644,root,root) %{_mandir}/man3/*.3.*
%attr(0755,root,root) %{_bindir}/net-snmp-config* %attr(0755,root,root) %{_bindir}/net-snmp-config*
%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* %attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*
%files perl -f perl.lst %files perl -f perl.lst
%defattr(-,root,root) %defattr(-,root,root)
@ -393,9 +396,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mib2c* %{_datadir}/snmp/mib2c*
%{_datadir}/snmp/*.pl %{_datadir}/snmp/*.pl
%{_bindir}/traptoemail %{_bindir}/traptoemail
%attr(0644,root,root) %{_mandir}/man[15]/mib2c* %attr(0644,root,root) %{_mandir}/man[15]/mib2c*
%attr(0644,root,root) %{_mandir}/man3/*.3pm.* %attr(0644,root,root) %{_mandir}/man3/*.3pm.*
%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* %attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*
%files python %files python
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -405,16 +408,27 @@ rm -rf ${RPM_BUILD_ROOT}
%files gui %files gui
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/tkmib %{_bindir}/tkmib
%attr(0644,root,root) %{_mandir}/man1/tkmib.1* %attr(0644,root,root) %{_mandir}/man1/tkmib.1*
%files libs %files libs
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING README ChangeLog.trimmed FAQ NEWS TODO
%{_libdir}/lib*.so.* %{_libdir}/lib*.so.*
%dir %{_datadir}/snmp %dir %{_datadir}/snmp
%dir %{_datadir}/snmp/mibs %dir %{_datadir}/snmp/mibs
%{_datadir}/snmp/mibs %{_datadir}/snmp/mibs/*
%changelog %changelog
* Tue Nov 24 2009 Jan Safranek <jsafrane@redhat.com> 1:5.5-2
- introduce /etc/sysconfig/snmptrapd. Use it to specify snmptrapd command
line options. /etc/snmp/snmptrapd.options is not used anymore (#540799)
- build-in ipAddressPrefixTable, ipDefaultRouterTable, ipv6ScopeZoneIndexTable,
ipIfStatsTable, SCTP-MIB, RMON-MIB and Etherlike-MIBs
- remove ucd5820stat helper script, it depends on get5820stats, which is not
available in Fedora
- move sample services ipf-mod.pl to documentation
- remove logrotate config, snmpd logs into syslog
* Tue Sep 29 2009 Jan Safranek Jan Safranek <jsafranek@redhat.com> 5.5-1 * Tue Sep 29 2009 Jan Safranek Jan Safranek <jsafranek@redhat.com> 5.5-1
- update to Net-SNMP 5.5 - update to Net-SNMP 5.5
- remove static libraries from -devel subpackage - remove static libraries from -devel subpackage

View File

@ -26,8 +26,8 @@
# source function library # source function library
. /etc/init.d/functions . /etc/init.d/functions
if [ -e /etc/snmp/snmptrapd.options ]; then if [ -e /etc/sysconfig/snmptrapd ]; then
. /etc/snmp/snmptrapd.options . /etc/sysconfig/snmptrapd
else else
OPTIONS="-Lsd -p /var/run/snmptrapd.pid" OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
fi fi

2
net-snmptrapd.sysconfig Normal file
View File

@ -0,0 +1,2 @@
# snmptrapd command line options
# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"