strange dlopen() problem with ucd-snmp RPM

John P. Looney john at antefacto.com
Thu Apr 4 13:11:18 CEST 2002


 This is a strange one.

 I use ucd-snmp a lot here in work. I added three of my own patches to the
RPM (one fixes a simple problem with snmptable, the others are to add some
ID fields so we can tell that it's running our version of ucd-snmp).

 I rebuilt it, and it would not load snmpd extensions - I usually have
something like:

dlmod antefacto /usr/share/snmp/modules/antefacto.so

 in my snmpd config file. This failed with;

Apr  3 12:19:02 bartender ucd-snmp[492]: /etc/snmp/snmpd.conf: line 24: Warning: Unknown token: dlmod. 

 So, I investigated, and found that although this was printed by
configure:

....
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether -lc should be explicitly linked in... no
....

 config.h did not have DLOPEN defined;

[root at bartender ucd-snmp-4.2.3]# grep DL config.h |grep -v MIBS
#define HAVE_DLFCN_H 1
/* #undef HAVE_DLOPEN */
#define HAVE_LIBDL 1
/* #undef HAVE_NET_IF_DL_H */
#define HAVE_STDLIB_H 1  

 I was able to fix this by changing the SPEC file of ucd-snmp from;

    --with-ldflags="%{rpmldflags}" \
 to
    --with-ldflags="-ldl %{rpmldflags}" \

 Does anyone know why this could happen ? This change is not required on
RedHat at all. The configure script notes that dlopen does work, and needs
-ldl - but it does not show this in config.log.

John

-- 
_______________________________________
John Looney             Chief Scientist
a n t e f a c t o     t: +353 1 8586004
www.antefacto.com     f: +353 1 8586014



More information about the pld-users-en mailing list