Kristján Valur Jónsson
2018-Jan-30 11:24 UTC
[Samba] Samba 4.7.4 + bind9 DLZ /backend/ dropping delegated domain
Right, that is the _workaround_. It'd be great to see that documented in the Wiki. However, samba_dlz is supposed to support reload, and there has been work on that file to fix slow reload previously. I"m currently doing experiments to figure out what is going wrong. One thing is clear, the messages from samba_dlz is confusing, since it is actually not "shutting down". Rather, samba_dlz, maintains a reference counted singleton of its state. What happens during reload is: 1) dlz_create is called. The refcount is upped, same internal instance returned to named and* nothing is logged.* 2) dlz_configure() is called. 3) dlz_destroy() is called. The refcount is decreased (from 2 to 1), nothing is destroyed, *but it incorrectly logs that it is shutting down!* Clearly, bind expects to start a new instance of its dlz, initialize it, and then destroy the old instance. I am hacking on this to figure out exactly where things fail. On 30 January 2018 at 10:26, Rowland Penny via samba <samba at lists.samba.org> wrote:> On Tue, 30 Jan 2018 11:18:24 +0100 > "L.P.H. van Belle via samba" <samba at lists.samba.org> wrote: > > > Hai, > > > > Check the content of : > > /etc/logrotate.d/named > > > > If you see > > postrotate > > /etc/init.d/smbd reload > /dev/null > > endscript > > > > Change that to > > postrotate > > if [ -d /run/systemd/system ]; then; systemctl -q is-active named > > && systemctl reload named; else; /etc/init.d/named reload ; fi'; > > endscript > > > > It is 'reload' that is the problem, you need to use 'restart' instead. > > Rowland > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba >-- Kv, Kristján Valur Jónsson, RVX
Rowland Penny
2018-Jan-30 11:55 UTC
[Samba] Samba 4.7.4 + bind9 DLZ /backend/ dropping delegated domain
On Tue, 30 Jan 2018 11:24:42 +0000 Kristján Valur Jónsson <kristjan at rvx.is> wrote:> Right, that is the _workaround_. It'd be great to see that > documented in the Wiki.It is now.> However, samba_dlz is supposed to support reload, and there has been > work on that file to fix slow reload previously. > I"m currently doing experiments to figure out what is going wrong. > > One thing is clear, the messages from samba_dlz is confusing, since > it is actually not "shutting down". > Rather, samba_dlz, maintains a reference counted singleton of its > state. What happens during reload is: > 1) dlz_create is called. The refcount is upped, same internal > instance returned to named and* nothing is logged.* > 2) dlz_configure() is called. > 3) dlz_destroy() is called. The refcount is decreased (from 2 to 1), > nothing is destroyed, *but it incorrectly logs that it is shutting > down!* > > Clearly, bind expects to start a new instance of its dlz, initialize > it, and then destroy the old instance. >Still not sure where the problem lies, if you are only reading the Bind source code, then the problem is a Bind one, but if you are also reading the Samba code, then it could be a Samba one. Rowland
Kristján Valur Jónsson
2018-Jan-30 12:54 UTC
[Samba] Samba 4.7.4 + bind9 DLZ /backend/ dropping delegated domain
No, I'm reading the dlz_bind9.c code. I've found and fixed the problem. It turns out that using a reference counted singleton is a bad idea. The singleton is defunct after reload. If we simply create a new state object and destroy the old one as bind is trying to let us do, things work out fine. This works, at least, for bind9.9. I cant test with the older (9.8), so it is possible that the singleton approach was necessary for that. Expect a pull request from me soon. On 30 January 2018 at 11:55, Rowland Penny via samba <samba at lists.samba.org> wrote:> On Tue, 30 Jan 2018 11:24:42 +0000 > Kristján Valur Jónsson <kristjan at rvx.is> wrote: > > > Right, that is the _workaround_. It'd be great to see that > > documented in the Wiki. > > It is now. > > > However, samba_dlz is supposed to support reload, and there has been > > work on that file to fix slow reload previously. > > I"m currently doing experiments to figure out what is going wrong. > > > > One thing is clear, the messages from samba_dlz is confusing, since > > it is actually not "shutting down". > > Rather, samba_dlz, maintains a reference counted singleton of its > > state. What happens during reload is: > > 1) dlz_create is called. The refcount is upped, same internal > > instance returned to named and* nothing is logged.* > > 2) dlz_configure() is called. > > 3) dlz_destroy() is called. The refcount is decreased (from 2 to 1), > > nothing is destroyed, *but it incorrectly logs that it is shutting > > down!* > > > > Clearly, bind expects to start a new instance of its dlz, initialize > > it, and then destroy the old instance. > > > > Still not sure where the problem lies, if you are only reading the Bind > source code, then the problem is a Bind one, but if you are also > reading the Samba code, then it could be a Samba one. > > Rowland > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba >-- Kv, Kristján Valur Jónsson, RVX