[net-snmp] re-introduce /etc/sysconfig files Resolves: #752821

Jan Šafránek jsafrane at fedoraproject.org
Mon Nov 28 13:13:18 UTC 2011


commit f30e598936285787ba0b9140e926deb83c191185
Author: Jan Safranek <jsafrane at redhat.com>
Date:   Mon Nov 28 14:12:57 2011 +0100

    re-introduce /etc/sysconfig files
    Resolves: #752821

 net-snmp.spec           |    9 ++++++---
 net-snmpd.sysconfig     |    7 ++-----
 net-snmptrapd.sysconfig |    7 ++-----
 snmpd.service           |    4 +++-
 snmptrapd.service       |    4 +++-
 5 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/net-snmp.spec b/net-snmp.spec
index 3608f3e..a56f957 100644
--- a/net-snmp.spec
+++ b/net-snmp.spec
@@ -11,7 +11,7 @@
 Summary: A collection of SNMP protocol tools and libraries
 Name: net-snmp
 Version: 5.7.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch: 1
 
 License: BSD
@@ -439,6 +439,8 @@ rm -rf ${RPM_BUILD_ROOT}
 %dir %{_localstatedir}/run/net-snmp
 %config(noreplace) %{_sysconfdir}/tmpfiles.d/net-snmp.conf
 %{_unitdir}/snmp*
+%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
+%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd
 
 %files utils
 %defattr(-,root,root,-)
@@ -505,10 +507,11 @@ rm -rf ${RPM_BUILD_ROOT}
 %defattr(-,root,root)
 %{_initrddir}/snmpd
 %{_initrddir}/snmptrapd
-%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
-%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd
 
 %changelog
+* Mon Nov 28 2011 Jan Safranek <jsafrane at redhat.com> - 1:5.7.1-3
+- re-introduced /etc/sysconfig files (#752821)
+
 * Wed Oct  5 2011 Jan Safranek <jsafrane at redhat.com> - 1:5.7.1-2
 - fixed perl linking (#742678)
 
diff --git a/net-snmpd.sysconfig b/net-snmpd.sysconfig
index fa38f79..6949ec0 100644
--- a/net-snmpd.sysconfig
+++ b/net-snmpd.sysconfig
@@ -1,6 +1,3 @@
-# WARNING:
-# This file is only for compatibility with SysV init scripts if someone uses
-# them! systemd does not use this file when starting snmpd!
-#
 # snmpd command line options
-# OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
+# '-f' is implicitly added by snmpd systemd unit file
+# OPTIONS="-LS0-6d"
diff --git a/net-snmptrapd.sysconfig b/net-snmptrapd.sysconfig
index 562203f..85e3128 100644
--- a/net-snmptrapd.sysconfig
+++ b/net-snmptrapd.sysconfig
@@ -1,6 +1,3 @@
-# WARNING:
-# This file is only for compatibility with SysV init scripts if someone uses
-# them! systemd does not use this file when starting snmpd!
-#
 # snmptrapd command line options
-# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
+# '-f' is implicitly added by snmptrapd systemd unit file
+# OPTIONS="-Lsd"
diff --git a/snmpd.service b/snmpd.service
index 3af5ea7..adb394d 100644
--- a/snmpd.service
+++ b/snmpd.service
@@ -4,7 +4,9 @@ After=syslog.target network.target
 
 [Service]
 Type=notify
-ExecStart=/usr/sbin/snmpd -LS0-6d -f
+Environment=OPTIONS="-LS0-6d"
+EnvironmentFile=-/etc/sysconfig/snmpd
+ExecStart=/usr/sbin/snmpd $OPTIONS -f
 ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
diff --git a/snmptrapd.service b/snmptrapd.service
index e4689a6..9835a38 100644
--- a/snmptrapd.service
+++ b/snmptrapd.service
@@ -4,7 +4,9 @@ After=syslog.target network.target
 
 [Service]
 Type=notify
-ExecStart=/usr/sbin/snmptrapd -Lsd -f
+Environment=OPTIONS="-Lsd"
+EnvironmentFile=-/etc/sysconfig/snmptrapd
+ExecStart=/usr/sbin/snmptrapd $OPTIONS -f
 ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]


More information about the scm-commits mailing list