move local state file from /var/net-snmp/ to /var/lib/net-snmp
This commit is contained in:
parent
f251033341
commit
9720b947ed
@ -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
|
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.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
|
+++ net-snmp-5.4.1/net-snmp-config.in 2008-07-25 12:53:19.000000000 +0200
|
||||||
|
@ -203,7 +203,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
|
|||||||
%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/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=%{_libdir} \
|
--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 -d ${RPM_BUILD_ROOT}%{_bindir}
|
||||||
install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}%{_bindir}/ucd5820stat
|
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}/snmpinform
|
||||||
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
|
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
|
||||||
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/snmpconf.1*
|
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 snmpd
|
||||||
/sbin/chkconfig --add snmptrapd
|
/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
|
%preun
|
||||||
if [ $1 = 0 ]; then
|
if [ $1 = 0 ]; then
|
||||||
service snmpd stop >/dev/null 2>&1
|
service snmpd stop >/dev/null 2>&1
|
||||||
@ -373,6 +378,7 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||||||
%attr(0644,root,root) %{_mandir}/man5/variables*
|
%attr(0644,root,root) %{_mandir}/man5/variables*
|
||||||
%dir %{_datadir}/snmp
|
%dir %{_datadir}/snmp
|
||||||
%{_datadir}/snmp/snmpconf-data
|
%{_datadir}/snmp/snmpconf-data
|
||||||
|
%dir %{_localstatedir}/lib/net-snmp
|
||||||
|
|
||||||
%files utils
|
%files utils
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
@ -425,6 +431,7 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||||||
%changelog
|
%changelog
|
||||||
* Wed Jul 1 2009 Jan Safranek <jsafranek@redhat.com> 5.4.2.1-13
|
* Wed Jul 1 2009 Jan Safranek <jsafranek@redhat.com> 5.4.2.1-13
|
||||||
- package cleanup, remove unnecessary patches
|
- 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
|
* 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
|
- make the default configuration less noisy, i.e. do not print "Connection from
|
||||||
|
Loading…
Reference in New Issue
Block a user