[Samba] Cannot open sam.ldb [Was: dlz_bind9.so not found] [SUCCESS/SOLVED]
Adam Tauno Williams
awilliam at whitemice.org
Tue Dec 6 09:21:52 MST 2011
On Tue, 2011-12-06 at 11:18 -0500, Adam Tauno Williams wrote:
> On Tue, 2011-12-06 at 11:11 -0500, Adam Tauno Williams wrote:
> > On Tue, 2011-12-06 at 10:47 -0500, Adam Tauno Williams wrote:
> > > On Sun, 2011-12-04 at 08:45 +0000, Marcel Ritter wrote:
> > > > the last configuration is the correct one.
> > > > However you may have to set LD_LIBRARY_PATH to the
> > > > directory containing libsamdb.so.0 (or other libraries it may complain
> > > > about during startup).
> > > I'm also using bind-9.8.1 on openSUSE 12.1 x86_64 and seeing something
> > > like the same problem.
> > > I run bind as -
> > > named -4 -c /etc/named.conf -g -u named -d 65535
> > > 06-Dec-2011 10:43:20.486 Loading 'AD DNS Zone' using driver dlopen
> > > 06-Dec-2011 10:43:20.486 Loading SDLZ driver.
> > > 06-Dec-2011 10:43:20.562 samba_dlz: Failed to connect
> > > to /opt/s4/private/dns/sam.ldb
> > > 06-Dec-2011 10:43:20.563 dlz_dlopen of 'AD DNS Zone' failed
> > > 06-Dec-2011 10:43:20.563 SDLZ driver failed to load.
> > > 06-Dec-2011 10:43:20.563 DLZ driver failed to load.
> > > Does that mean it loaded the samba_dlz driver? [I have /opt/s4/lib
> > > in /etc/ld.so.conf.d/s4.conf, and have run /sbin/ldconfig]
> > > The group named has rw- for /opt/s4/private/dns/sam.ldb
> > > It doesn't seem terribly informative.
> > Via strace I clearly see -
> > 2434 mmap(NULL, 2105528, PROT_READ|PROT_EXEC, MAP_PRIVATE|
> > MAP_DENYWRITE, 9, 0) = 0x7fc8f850c000
> > 2434 mprotect(0x7fc8f850e000, 2093056, PROT_NONE) = 0
> > 2434 mmap(0x7fc8f870d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|
> > MAP_FIXED|MAP_DENYWRITE, 9, 0x1000) = 0x7fc8f870d000
> > 2434 close(9) = 0
> > 2434 mprotect(0x7fc8f870d000, 4096, PROT_READ) = 0
> > 2434 stat("/opt/s4/modules/ldb", {st_mode=S_IFDIR|0755,
> > st_size=4096, ...}) = 0
> > 2434 stat("/opt/s4/modules/ldb", {st_mode=S_IFDIR|0755,
> > st_size=4096, ...}) = 0
> > 2434 stat("/opt/s4/private/dns/sam.ldb", 0x7fc9123692a0) = -1 EACCES
> > (Permission denied)
> > 2434 open("/opt/s4/private/dns/sam.ldb", O_RDWR|O_CREAT, 0600) = -1
> > EACCES (Permission denied)
> > 2434 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2202, ...})
> > = 0
> > after it has opened a bunch of Samba libraries and read
> > from /opt/s4/etc/smb.conf
> > In /etc/selinux/config I have SELINUX=disabled
> It was a permissions problem. Changing the permissions -
> linux-uf10:~ # chmod 777 /opt/s4/private/dns/sam.ldb
> linux-uf10:~ # chmod 777 /opt/s4/private/dns
> linux-uf10:~ # chmod 777 /opt/s4/private
> - changed the error. :(
> linux-uf10:~ # named -4 -c /etc/named.conf -g -u named
> 06-Dec-2011 11:14:35.735 Loading 'AD DNS Zone' using driver dlopen
> ldb: module partition initialization failed : Operations error
> ldb: module show_deleted initialization failed : Operations error
strace again comes to the rescue; and makes it blindingly obvious that I
overlooked the obvious. /opt/s4/private/dns/sam.ldb is a file, there is
also a /opt/s4/private/dns/sam.ldb.d directory. Fix the permissions
there as well and bind starts...
06-Dec-2011 11:19:07.018 Loading 'AD DNS Zone' using driver dlopen
06-Dec-2011 11:19:07.303 samba_dlz: started for DN DC=micore,DC=us
06-Dec-2011 11:19:07.304 samba_dlz: starting configure
06-Dec-2011 11:19:07.307 samba_dlz: configured writeable zone
'micore.us'
06-Dec-2011 11:19:07.310 samba_dlz: configured writeable zone
'_msdcs.micore.us'
06-Dec-2011 11:19:07.312 set up managed keys zone for view _default,
file 'managed-keys.bind'
BAM!
More information about the samba
mailing list