move local state file from /var/net-snmp/ to /var/lib/net-snmp

This commit is contained in:
Jan Šafránek 2009-07-01 13:53:01 +00:00
parent f251033341
commit 9720b947ed
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,5 @@
Assume that the configuration is in /etc/snmp, instead of /usr/share/snmp
diff -up net-snmp-5.4.1/net-snmp-config.in.backup_patch_6 net-snmp-5.4.1/net-snmp-config.in
--- net-snmp-5.4.1/net-snmp-config.in.backup_patch_6 2007-06-30 00:18:27.000000000 +0200
+++ net-snmp-5.4.1/net-snmp-config.in 2008-07-25 12:53:19.000000000 +0200

View File

@ -203,7 +203,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
%endif
--with-sys-location="Unknown" \
--with-logfile="/var/log/snmpd.log" \
--with-persistent-directory="/var/net-snmp" \
--with-persistent-directory="/var/lib/net-snmp" \
--with-mib-modules="$MIBS" \
%if %{tcp_wrappers}
--with-libwrap=%{_libdir} \
@ -278,6 +278,8 @@ 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
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/snmpconf.1*
@ -328,6 +330,9 @@ dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
/sbin/chkconfig --add snmpd
/sbin/chkconfig --add snmptrapd
# 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
%preun
if [ $1 = 0 ]; then
service snmpd stop >/dev/null 2>&1
@ -373,6 +378,7 @@ rm -rf ${RPM_BUILD_ROOT}
%attr(0644,root,root) %{_mandir}/man5/variables*
%dir %{_datadir}/snmp
%{_datadir}/snmp/snmpconf-data
%dir %{_localstatedir}/lib/net-snmp
%files utils
%defattr(-,root,root,-)
@ -425,6 +431,7 @@ rm -rf ${RPM_BUILD_ROOT}
%changelog
* Wed Jul 1 2009 Jan Safranek <jsafranek@redhat.com> 5.4.2.1-13
- package cleanup, remove unnecessary patches
- move local state file from /var/net-snmp/ to /var/lib/net-snmp
* Wed Jul 1 2009 Jan Safranek <jsafranek@redhat.com> 5.4.2.1-12
- make the default configuration less noisy, i.e. do not print "Connection from