[Pkg-net-snmp-devel] Bug#475366: Bug#475366: snmpd silently fails to start if no interface specified on commandline

Olivier Berger olivier.berger at int-edu.eu
Thu Apr 10 12:17:07 UTC 2008


On Thu, Apr 10, 2008 at 01:52:55PM +0200, Jochen Friedrich wrote:
> Hi Olivier,
> 
> > Reading the man snmpd, I'm tempted to believe snmpd will detect interfaces to listen on if started without an explicit interface in arguments :
> >  " By default, snmpd listens for incoming SNMP requests on UDP port 161 on all IPv4 interfaces.  However, it is possible to modify this behaviour by specifying one or
> >   more listening addresses as arguments to snmpd."
> 
> That's correct :)
> 
> > However, if started manually (or without 127.0.0.1 last argument in /etc/default/snmpd) it will abort, and return 0. As a consequence, the /etc/init.d/snmpd script returns as if nothing was wrong...
> 
> That's very strange and I can't replicate this here. This is /etc/default/snmpd I am using here with 5.4.1~dfsg-6:
> 

OK, I see what's happening.

I straced snmpd and got : 

uname({sys="Linux", node="kilauea", ...}) = 0
getsockopt(8, SOL_SOCKET, SO_SNDBUF, [110592], [4]) = 0
getsockopt(8, SOL_SOCKET, SO_RCVBUF, [110592], [4]) = 0
setsockopt(8, SOL_IP, IP_PKTINFO, [1], 4) = 0
bind(8, {sa_family=AF_INET, sin_port=htons(161), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
close(8)                                = 0
write(3, "Error opening specified endpoint"..., 36) = 36

It seems I have a conflict with the snmpd daemon running inside my vserver guest... which prevents the host daemon to bind too...

OK, OK.

So it seems that although the vserver guest has no localhost interface on 127.0.0.1 (and only a 10.1.1.10 dummy0 interface), it still starts listening on UDP:10.1.1.10:161 even if 127.0.0.1 is passed on the commandline...

However, if no interface is specified on the host, it won't bind on any, because the vserver guest was bound before... kinda weird :(

Well... I guess that for my setup it's a bit a specific case where I should explicitely mention which IPs/interfaces I want them to listen on.


Still, then the 127.0.0.1 specification and a non-existant interface providing it should have it fail on the guest vserver, I suppose... Maybe needs a separate bug report.

Your comments ?

Best regards,





More information about the Pkg-net-snmp-devel mailing list