Ticket #52 (closed enhancement: fixed)

Opened 20 months ago

Last modified 19 months ago

Make the database drivers loadable modules

Reported by: smoku Owned by: smoku
Priority: major Component: storage
Version: 2.1 Keywords:
Cc: Tracforge_linkmap:
Blocking: Blocked By:

Description

When creating a binary distribution of jabberd2 (e.g. RPM or deb) you can never know which database backend the user wants to use for storage and authreg. So the options are to either go with a default and force the user who wants to use something else to rebuild the package, or include as many database drivers as possible, and force the user to install all database library packages jabberd is linked against, even if they aren't actually being used in his setup. Both situations are not what a user can expect from a binary package.

To overcome this dilemma, I've turned the database drivers into dynamically loadable modules, so that only the database modules that are actually used by c2s and sm get loaded and add their runtime dependencies to jabberd.

This has so far only been tested on Linux, but I expect it to work everywhere where dlopen is supported. If support for a wider range of platforms is needed, I could try to use libltdl that comes with libtool.

Attachments

jabberd-dbmodules.patch (17.0 KB) - added by smoku 20 months ago.
Patch by Reinhard Max <max@…>
jabberd2-alt-storage-auth-modules.patch (26.6 KB) - added by alex@… 20 months ago.
Another way to do it

Change History

Changed 20 months ago by smoku

Patch by Reinhard Max <max@…>

Changed 20 months ago by alex@…

Another way to do it

Changed 20 months ago by alex@…

Also for use my patch must to do this: mv c2s/authreg_anon.c modules/anon/authreg_anon.c mv c2s/authreg_db.c modules/db/authreg_db.c mv c2s/authreg_ldap.c modules/ldap/authreg_ldap.c mv c2s/authreg_mysql.c modules/mysql/authreg_mysql.c mv c2s/authreg_pam.c modules/pam/authreg_pam.c mv c2s/authreg_pgsql.c modules/pgsql/authreg_pgsql.c mv c2s/authreg_pipe.c modules/pipe/authreg_pipe.c mv c2s/authreg_sqlite.c modules/sqlite/authreg_sqlite.c

mv sm/storage_db.c modules/db/storage_db.c mv sm/storage_fs.c modules/fs/storage_fs.c mv sm/storage_mysql.c modules/mysql/storage_mysql.c mv sm/storage_oracle.c modules/oracle/storage_oracle.c mv sm/storage_pgsql.c modules/pgsql/storage_pgsql.c mv sm/storage_sqlite.c modules/sqlite/storage_sqlite.c

Changed 20 months ago by smoku

  • status changed from new to assigned
  • type changed from defect to enhancement

Changed 19 months ago by smoku

  • status changed from assigned to closed
  • resolution set to fixed

(In [180]) Dynamically loading auth/reg/storage modules. Closes #52

Note: See TracTickets for help on using tickets.