Hello community,

here is the log from the commit of package net-snmp for openSUSE:Factory 
checked in at 2016-04-12 19:00:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/net-snmp (Old)
 and      /work/SRC/openSUSE:Factory/.net-snmp.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "net-snmp"

Changes:
--------
--- /work/SRC/openSUSE:Factory/net-snmp/net-snmp.changes        2016-02-29 
09:11:44.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp.changes   2016-04-12 
19:00:23.000000000 +0200
@@ -1,0 +2,8 @@
+Tue Mar 15 09:09:41 UTC 2016 - abergm...@suse.com
+
+- make snmpd and snmptrapd log message destination configurable
+  for syslog or a dedicated log file. (bsc#695677)
+- make snmpd and snmptrapd listening address(es) configurable via
+  the sysconfig file.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ net-snmp.spec ++++++
--- /var/tmp/diff_new_pack.r9jlcy/_old  2016-04-12 19:00:24.000000000 +0200
+++ /var/tmp/diff_new_pack.r9jlcy/_new  2016-04-12 19:00:24.000000000 +0200
@@ -240,6 +240,7 @@
        --enable-ucd-snmp-compatibility \
         --with-security-modules=tsm \
        --with-transports=TLSTCP,DTLSUDP
+
 # Parallel building is disabled because dependencies between the Perl
 # module and libnetsnmp are not correctly defined.
 make #%{?_smp_mflags}

++++++ net-snmp.sysconfig ++++++
--- /var/tmp/diff_new_pack.r9jlcy/_old  2016-04-12 19:00:24.000000000 +0200
+++ /var/tmp/diff_new_pack.r9jlcy/_new  2016-04-12 19:00:24.000000000 +0200
@@ -3,7 +3,7 @@
 ## Type:        string(!,a,c,e,w,n,i,d,0,1,2,3,4,5,6,7)
 ## Default:     n
 #
-# Defines the log level for snmpd.
+# Defines the log level for snmpd and snmptrapd.
 #
 # The default is "n" (5, LOG_NOTICE)
 #
@@ -34,3 +34,27 @@
 # The default is "yes" to provide backward compatibility.
 #
 SNMPD_LOG_SUCCESSFUL_CONNECTIONS="yes"
+
+## Path:        System/Net-SNMP
+## Description: Log Destination
+## Type:        string(F,S)
+## Default:     S
+#
+# Defines the log destination for snmpd and snmptrapd.
+#
+# By setting it to "F", snmpd will write log messages into 
'/var/log/net-snmpd.log'.
+#
+# The default is "S" to log messages through the syslog service.
+#
+SNMPD_LOGDEST="S"
+
+## Path:        System/Net-SNMP
+## Description: Listening IP addresses
+## Type:        string
+## Default:     "" (empty - listen on all interfaces) 
+#
+# Defines the IP address(es) that snmpd and snmptrapd binds to.
+# If no address is defined the daemon will listen on all interfaces.
+#
+SNMPD_LISTEN=""
+

++++++ rc.snmpd ++++++
--- /var/tmp/diff_new_pack.r9jlcy/_old  2016-04-12 19:00:24.000000000 +0200
+++ /var/tmp/diff_new_pack.r9jlcy/_new  2016-04-12 19:00:24.000000000 +0200
@@ -79,17 +79,27 @@
     start)
         echo -n "Starting snmpd"
         #
+        # log destination "F" for file.
         # do not even try to start if the log file is (2GB-1MB) big.
         # the snmpd doesnt handle LFS properly
         #
-        SNMPD_LOGFILE="${SNMPD_LOGFILE:-/var/log/net-snmpd.log}"
-        if [ -e "$SNMPD_LOGFILE" ] ; then
-        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\" is too large. Running 'logrotate' 
for net-snmp." >&2
-            /usr/sbin/logrotate /etc/logrotate.d/net-snmp
+        if [ ${SNMPD_LOGDEST:-F} = "F" ]; then
+          SNMPD_LOGTARGET="${SNMPD_LOGTARGET:-/var/log/net-snmpd.log}"
+          if [ -e "$SNMPD_LOGTARGET" ] ; then
+            SNMPD_SIZE_LOGFILE="$(stat -c "%s" $SNMPD_LOGTARGET)"
+            SNMPD_SIZE_MAX="1073741824"
+            if [ $SNMPD_SIZE_LOGFILE -gt $SNMPD_SIZE_MAX ] ; then
+              echo -e "\n\"$SNMPD_LOGTARGET\" is too large. Running 
'logrotate' for net-snmp." >&2
+              /usr/sbin/logrotate /etc/logrotate.d/net-snmp
+            fi
+          fi
         fi
+        #
+        # log destination "S" for syslog.
+        # define syslog facility to 'd' for LOG_DAEMON.
+        #
+        if [ ${SNMPD_LOGDEST:-F} = "S" ]; then
+         SNMPD_LOGTARGET="d"
         fi
         get_agents
         # Don't add -c /etc/snmp/snmpd.conf, as it is loaded by default.
@@ -112,7 +122,7 @@
         if [ ! -d /var/run/agentx ]; then
           mkdir -m 0700 /var/run/agentx
         fi
-        startproc $SNMPD $SNMPDCONF -r -A -LF ${SNMPD_LOGLEVEL:-n} 
$SNMPD_LOGFILE -p $SNMPD_PID $agentargs $SNMPDNOSMUX $SNMPDNOTCPWRAPPERLOG
+        startproc $SNMPD $SNMPDCONF -r -A -L${SNMPD_LOGDEST:-F} 
${SNMPD_LOGLEVEL:-n} $SNMPD_LOGTARGET -p $SNMPD_PID $agentargs $SNMPDNOSMUX 
$SNMPDNOTCPWRAPPERLOG $SNMPD_LISTEN
         rc_status -v
         rc_reset
 

++++++ rc.snmptrapd ++++++
--- /var/tmp/diff_new_pack.r9jlcy/_old  2016-04-12 19:00:24.000000000 +0200
+++ /var/tmp/diff_new_pack.r9jlcy/_new  2016-04-12 19:00:24.000000000 +0200
@@ -17,7 +17,7 @@
 
 SNMPTRAPD=/usr/sbin/snmptrapd
 SNMPTRAPD_CONF="/etc/snmp/snmptrapd.conf"
-SNMPTRAPD_LOGFILE="/var/log/net-snmpd.log"
+SNMPTRAPD_LOGTARGET="/var/log/net-snmpd.log"
 SNMPTRAPD_PID="/var/run/snmptrapd.pid"
 
 test -x $SNMPTRAPD || { echo "$SNMPTRAPD not installed";
@@ -66,11 +66,24 @@
 else
   SNMPTRAPD_CONF="-c $SNMPTRAPD_CONF"
 fi
-SNMPTRAPD_LOGFILE="${SNMPTRAPD_LOGFILE:-/var/log/net-snmpd.log}"
+#
+# If log destination is set to "F" define a log file.
+#
+if [ ${SNMPD_LOGDEST:-S} = "F" ]; then
+  SNMPTRAPD_LOGTARGET="${SNMPTRAPD_LOGTARGET:-/var/log/net-snmpd.log}"
+fi
+#
+# If log destionation is set to "S" use syslog LOG_DAEMON facility.
+#
+if [ ${SNMPD_LOGDEST:-S} = "S" ]; then
+  SNMPTRAPD_LOGTARGET="d"
+fi
+
 case "$1" in
     start)
         echo -n "Starting snmptrapd: "
-        startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -LF ${SNMPD_LOGLEVEL:-n} 
$SNMPTRAPD_LOGFILE -p $SNMPTRAPD_PID
+        startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -L${SNMPD_LOGDEST:-S} 
${SNMPD_LOGLEVEL:-n} $SNMPTRAPD_LOGTARGET -p $SNMPTRAPD_PID $SNMPD_LISTEN
+
         rc_status -v
         ;;
     stop)


Reply via email to