For last half a year VFS modules were unable to get loaded in FreeBSD 5.x. The error message was quite misleading: Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] lib/module.c:do_smb_load_module(57) Nov 20 13:21:52 wader kernel: Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] lib/module.c:do_smb_load_module(57) Nov 20 13:21:52 wader smbd[87549]: Error trying to resolve symbol 'init_module' in /usr/local/lib/samba/vfs/recycle.so : Shared object "nss_files.so.1" not found, required by "smbd" Nov 20 13:21:52 wader kernel: Nov 20 13:21:52 wader smbd[87549]: Error trying to resolve symbol 'init_module' in /usr/local/lib/samba/vfs/recycle.so: Shared object "nss_files.so.1" not found, required by "smbd" Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] smbd/vfs.c:vfs_init_custom(256) Nov 20 13:21:52 wader kernel: Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] smbd/vfs.c:vfs_init_custom(256) Nov 20 13:21:52 wader smbd[87549]: Can't find a vfs module [recycle] Nov 20 13:21:52 wader kernel: Nov 20 13:21:52 wader smbd[87549]: Can't find a vfs module [recycle] Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] smbd/vfs.c:smbd_vfs_init(319) Nov 20 13:21:52 wader kernel: Nov 20 13:21:52 wader smbd[87549]: [2004/11/20 13:21:52, 0] smbd/vfs.c:smbd_vfs_init(319) Nov 20 13:21:52 wader smbd[87549]: smbd_vfs_init: vfs_init_custom failed for recycle The funny thing is that nss_files.so not meant to exist at all in FreeBSD. So, after sevire digging into the changes in the OS code the real cause was found. To make long thing short, the problem lays in the way how dlopen/dlsym is used in Samba. It's technically possible, that dlopen() get non-fatal error(s) during execution(or, better call them warnings)that dlerror() will happily return later. Unfortunatelly, if you'll make call to dlsym() after such dlopen() with warning, and then check failure of dlsym() via call to dlopen() - you'll get an error from a previous stage, dlopen(). As Samba uses that error as the only indication of dlsym() failure, any VFS module can't be loaded... The cure is amasingly simple - just call dlerror() explicitly before the call to dlsym(). At least on Debian Linux man pages especially stress that way of dealing with dynamic loading. With regards, Timur Bakeyev.
Created attachment 812 [details] Fix to the dlopen/dlsym sequence Here is the propossed patch to fix the problem. Works fine with FreeBSD, should work on any other system too.
Good patch - applied. Thanks. Jeremy.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.