Menu

#36 5.3.0.1 SIGHUP breaks daemons

closed
None
1
2012-11-09
2006-04-19
John Hardin
No

After receiving a SIGHUP the agent forgets about all
supported MIBs. Before the SIGHUP I can walk MIBs and
GET objects. After the SIGHUP the agent responds to
all walks with "End of MIB view" and to all GETs with
"No Such Object".

I'm using Linux and am able to reproduce this at will
on both a 32-bit system running the 2.4 kernel and on a
64-bit system running the 2.6 kernel. I'm seeing this
problem with Net-SNMP version 5.3.0.1 but the problem
did not seem to exist in 5.2.1.

Here's an example of the problem:

$ /usr/sbin/snmpd -c /etc/snmp/snmpd.conf -C
127.0.0.1:161 10.1.0.36:161
$ snmpget -c public localhost system.sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux jh_venturi
2.4.26 #5 SMP Tue Sep 7 14:30:45 PDT 2004 i686
$ ps axwww |grep snmpd
8595 ? S 0:00 /usr/sbin/snmpd -c
/etc/snmp/snmpd.conf -C 127.0.0.1:161 10.1.0.36:161
9092 pts/0 S 0:00 grep snmpd
$ kill -HUP 8595
$ snmpget -c public localhost system.sysDescr.0
SNMPv2-MIB::sysDescr.0 = No Such Object available on
this agent at this OID

I've simplified things down to the point where I'm
taking mostly defaults, so here's
the output of net-snmp-config:

$ ./net-snmp-config --configure-options
'--prefix=/usr'

The only thing in my snmpd.conf file is this:

rocommunity public

There were no changes to the snmpd.conf file before or
after the SIGHUP.

When I retried running with debug parameters thusly:

$ /usr/sbin/snmpd -f -Le -Dread_config -c
/etc/snmp/snmpd.conf -C 127.0.0.1:161 10.1.0.36:161

snmpd.out 2>snmpd.err

The snmpd.out was empty and here's what was output to
stderr, from the point of
startup, through the SIGHUP and then the SIGTERM:

registered debug token read_config, 1
read_config: reading premib configuration tokens
read_configs_optional: reading optional configuration
tokens for snmpd
read_config: Reading optional config file:
"/etc/snmp/snmpd.conf"
read_config: Reading configuration /etc/snmp/snmpd.conf
read_config: /etc/snmp/snmpd.conf:1 examining:
rocommunity public
read_config: reading normal configuration tokens
read_configs_optional: reading optional configuration
tokens for snmpd
read_config: Reading optional config file:
"/etc/snmp/snmpd.conf"
read_config: Reading configuration /etc/snmp/snmpd.conf
read_config: /etc/snmp/snmpd.conf:1 examining:
rocommunity public
read_config: Found a parser. Calling it: rocommunity /
public
read_config: storing: #
# net-snmp (or ucd-snmp) persistent data file.
#
############################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
#
# **** DO NOT EDIT THIS FILE ****
#
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
############################################################################
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for snmpd in
SNMPCONFPATH/snmpd.conf.
# Only "createUser" tokens should be placed here by
snmpd administrators.
# (Did I mention: do not edit this file?)
#

read_config: storing: setserialno 552009661
read_config: storing:
##############################################################
read_config: storing: #
# snmpNotifyFilterTable persistent data
#
read_config: storing:
##############################################################
read_config: storing:

read_config: storing:
##############################################################
read_config: storing: #
# ifXTable persistent data
#
read_config: storing: ifXTable .1 14:0 16:0 18:0x $
read_config: storing: ifXTable .2 14:0 16:0 18:0x $
read_config: storing: ifXTable .3 14:0 16:0 18:0x $
read_config: storing: ifXTable .4 14:0 16:0 18:0x $
read_config: storing: ifXTable .5 14:0 16:0 18:0x $
read_config: storing:
##############################################################
read_config: storing:

read_config: storing: engineBoots 1
read_config: storing: oldEngineID
0x80001f88807258653372584644
NET-SNMP version 5.3.0.1
Reconfiguring daemon
NET-SNMP version 5.3.0.1 restarted
read_config: reading normal configuration tokens
read_configs_optional: reading optional configuration
tokens for snmpd
read_config: Reading optional config file:
"/etc/snmp/snmpd.conf"
read_config: Reading configuration /etc/snmp/snmpd.conf
read_config: /etc/snmp/snmpd.conf:1 examining:
rocommunity public
read_config: Found a parser. Calling it: rocommunity /
public
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
error on subcontainer '' insert (-1)
Received TERM or STOP signal... shutting down...
read_config: storing: #
# net-snmp (or ucd-snmp) persistent data file.
#
############################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
#
# **** DO NOT EDIT THIS FILE ****
#
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
############################################################################
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for snmpd in
SNMPCONFPATH/snmpd.conf.
# Only "createUser" tokens should be placed here by
snmpd administrators.
# (Did I mention: do not edit this file?)
#

read_config: storing: setserialno 552009661
read_config: storing:
##############################################################
read_config: storing: #
# snmpNotifyFilterTable persistent data
#
read_config: storing:
##############################################################
read_config: storing:

read_config: storing:
##############################################################
read_config: storing: #
# ifXTable persistent data
#
read_config: storing: ifXTable .1 14:0 16:0 18:0x $
read_config: storing: ifXTable .2 14:0 16:0 18:0x $
read_config: storing: ifXTable .3 14:0 16:0 18:0x $
read_config: storing: ifXTable .4 14:0 16:0 18:0x $
read_config: storing: ifXTable .5 14:0 16:0 18:0x $
read_config: storing:
##############################################################
read_config: storing:

read_config: storing: engineBoots 1
read_config: storing: oldEngineID
0x80001f88807258653372584644

Discussion

  • Thomas Anders

    Thomas Anders - 2006-04-20

    Logged In: YES
    user_id=848638

    Verified to be a bug that exists in the 5.3.x and MAIN CVS
    branches, but not in the 5.2.x branch.

     
  • Thomas Anders

    Thomas Anders - 2006-04-20

    Logged In: YES
    user_id=848638

    Verified to be a bug that exists in the 5.3.x and MAIN CVS
    branches, but not in the 5.2.x branch.

     
  • Robert Story

    Robert Story - 2006-04-20

    Logged In: YES
    user_id=76148

    Try the attached patch... will commit to cvs as soon as SF
    comes back online...

     
  • Thomas Anders

    Thomas Anders - 2006-04-20

    Logged In: YES
    user_id=848638

    promoted as an official patch.

     
  • Robert Story

    Robert Story - 2006-04-20

    Logged In: YES
    user_id=76148

    affects snmptrapd too.. new patch for fixing both.. checked
    in to cvs for 5.3.x and main.

     
  • Robert Story

    Robert Story - 2006-04-20

    daemon hup vacm fixes

     
  • John Hardin

    John Hardin - 2006-04-20

    Logged In: YES
    user_id=83127

    This appears to fix the problem. Thanks for the quick response!

     

Log in to post a comment.