[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: slapi plugin link problem in 2.2.9 (ITS#3098)
Maybe solved... I found a link:
http://sources.redhat.com/autobook/autobook/autobook_165.html#SEC165
That suggested I add the -export-dynamic link option to make the
slap_schema symbol available to the modules. When I used this to link
slapd the module loaded.
I'm not how sure sure if this is a safe/wise thing to to though.
Kind regards,
Martin.
On Tue, 2004-04-20 at 09:06, m.d.t.evans@qmul.ac.uk wrote:
> Full_Name: Martin Evans
> Version: 2.2.9
> OS: Linux 2.4.X
> URL:
> Submission from: (NULL) (217.42.114.74)
>
>
> Hi,
>
> I'm having some trouble loading the addrdnvalues.c slapi plugin (and my own
> plugin which generates the same errors). Slapd fails to initialise the plugin
> and shuts down quietly with no error reports...
>
> slapd.conf contains:
>
> # slapi plugins
> pluginlog /home/martin/pluginlog
> plugin preoperation /path/libaddrdnvalues-plugin.so addrdnvalues_preop_init
>
> The problem always occurs with the lt_dlopen in slapd/slapi/plugin.c. I've
> modified my plugin.c like to generate an error message...
>
> /* load in the module */
> *pLdHandle = lt_dlopen( path );
> if ( *pLdHandle == NULL ) {
> + printf("load2\n");
> + perror(lt_dlerror ());
> return LDAP_LOCAL_ERROR;
> }
>
> Linking the example with the link line from the README file. i.e:
>
> gcc -shared -I../../../include -Wall -g -o libaddrdnvalues-plugin.so
> addrdnvalues.c
>
> and running slapd with:
>
> LD_LIBRARY_PATH=/path/to/installed/openldap-2.2.9/lib
>
> set gives the following slapi_pblock_get error:
>
> line 166 (pluginlog /home/martin/pluginlog)
> line 168 (plugin preoperation
> /home/martin/tasks/openldap/src/openldap-2.2.9/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so
> addrdnvalues_preop_init)
> load2
> /home/martin/tasks/openldap/src/openldap-2.2.9/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so:
> undefined symbol: slapi_pblock_get: No such file or directory
> /home/martin/tasks/openldap/installed/openldap-2.2.9/etc/openldap/slapd-provider.conf:
> line 168: SLAPI config read failed.
> slapd shutdown: freeing system resources.
> slapd stopped.
> connections_destroy: nothing to destroy.
>
> Linking in libslapi like so:
>
> $ gcc -shared -I../../../include -Wall -g -o libaddrdnvalues-plugin.so
> addrdnvalues.c -L /path/to/installed/openldap-2.2.9/lib/ -lslapi
>
> Running slapd with d-1 gives:
>
> line 166 (pluginlog /home/martin/pluginlog)
> line 167 (plugin preoperation /home/martin/cvs/slapi.precvs/unix_preop.so
> unix_preop_init)
> load2
> /home/martin/tasks/openldap/installed/openldap-2.2.9/lib/libslapi-2.2.so.7:
> undefined symbol: slap_schema: No such file or directory
> /home/martin/tasks/openldap/installed/openldap-2.2.9/etc/openldap/slapd-provider.conf:
> line 167: SLAPI config read failed.
> slapd shutdown: freeing system resources.
> slapd stopped.
> connections_destroy: nothing to destroy.
>
> Note that there are also a few other minor modifications to config.c and
> plugin.c to print an error if the initialisation fails. The following one may be
> worth keeping because it tells you that there was at least some sort of problem
> with the plugins before shutting down:
>
> --- config.c.0 2004-04-19 16:22:59.000000000 +0100
> +++ config.c 2004-04-19 16:24:12.000000000 +0100
> @@ -2478,6 +2478,14 @@
>
> if ( slapi_int_read_config( be, fname, lineno, cargc,
> cargv )
> != LDAP_SUCCESS ) {
> +#ifdef NEW_LOGGING
> + LDAP_LOG( CONFIG, INFO,
> + "%s: line %d: SLAPI config read failed.\n",
> + fname, lineno, 0 );
> +#else
> + Debug( LDAP_DEBUG_ANY, "%s: line %d: SLAPI "
> + "config read failed.\n", fname, lineno, 0 );
> +#endif
> return( 1 );
> }
> slapi_plugins_used++;
>
>
> Kind regards,
> Martin.
--
-- Dr MDT Evans, Computing Services, Queen Mary, University of London