Samba vs Samba4? (GSoC question)

Matthieu Patou mat at matws.net
Thu Aug 15 00:10:50 MDT 2013


On 08/10/2013 10:40 AM, luke morrison wrote:
> Hello Samba-technical,
> My name is Luke Morrison and this is not my first time emailing to Samba-Technical. This may be my last big comprehensive "push" for my GSoC project. So sorry in advance if I touch on more than just one thing in the process.
> I will try and not make it too long, but at the same time be as specific with my question as possible,
> To my understanding dynamic DNS makes use of asynchronous events in the memory loop that is samba.
Well yes and no, I don't really know what you call dynamic DNS, dynamic 
DNS updates are handled by the DNS server if Samba AD DC (also called 
Samba4 in the past) is the internal one then it's likely that the 
request will be process asynchronously using samba's event library 
(tevent) most (at least the majority) of the services/task in samba are 
now written in an async manner.

But if Samba relies on an external DNS server (ie. Bind) then tevent 
didn't play any role.

Now there is another part in the "dynamic DNS", for a lot of reasons 
(some historical) Samba AD DC use dynamic DNS updates to update records 
related to itself (ie. SRV records about sites, global catalog, and a 
few other gazillion ones).

To do this we use a python script roughly and we use tevent to process 
signal generated by the execution of this script, as it's a script it 
will be executed in another process and is by nature running in a async 
manner.
> That is "tevent" is the main tool used to process signals, events, timers and handlers.
Correct
>   I also think that in order to create a new service aka gpoupdates (on server end), I would also have to make use of such tools.
Correct
>   If these assumptions are wrong, feel free to correct me.

> So here is my question: Is the service initialized in the build process?
So in the loadparm we define a list of service that are started by Samba 
when samba starts

This list can always be overridden in the smb.conf to tailor to 
particular needs.
> So when the samba daemons start, if there is an event loop that was finished before due to samba stopping, how does it be able to restart?
So there is the Samba AD DC (and in some other programs too but I'm less 
familiar so I won't tell much) a big event loop that take place just 
after the init of Samba that has the role of listening to the different 
event and react to different signal and timer.
Depending on the configuration of each service this big loop might or 
might not restart the service if has stopped. A good example is that the 
LDAP service if it crash is not restarted for the moment (at least in my 
recent memory), a service that would rely on periodic timer that would 
forget to rearm a new timer at the end of each periodic execution would 
also not be restarted.
> In other words, abarltet on IRC informed me that "it is all within the source code". This is very helpful as a programmer, because it makes me think that I can just write a .c file as a handler for events and timers and execute my gpoupdate pyfile. I strongly believe that for prototyping, a lot of ldb management and file handling, python is a billion times more simple, so I want to keep that end python. But for events, updates synchronous events, do I have a choice but to use .c (there is always a choice, but which is "better"?).

> And how does Samba get initilized, the whole old school C load_parm_context thing is a bit fuzzy for new development. I caught on quickly to samdb, because it is in python and quite explicit, but in terms of Samba, like the original Samba, would I have to initialize it in n "old" school way to start this service? Any clues or model boiler plate code files recommended to see exactly how this is done?
>
Ask your mentor :-)

Matthieu.


More information about the samba-technical mailing list