Andrew Tridgell
1998-Apr-22 02:48 UTC
Browsing across subnets - some more problems (PR#6450)
>> - Why does nmbd appear to be running twice on some machines? > > nmbd, like smbd is a "fork and exec" daemon. When a new request comes > it, it forks. This new image deals with the request, while the parent > process waits for new requests.nope, not at all. nmbd is a "one process handles all requests" daemon. You see two daemons because at startup nmbd forks so that it can have a separate "asynch DNS" server. This is to overcome the problem that gethostbyname() is a blocking call. If you run netscape on a unix system then you will see that it too has two processes for exactly the same reason. In general this is the only reasonable way to do asynchronous DNS lookups on unix systems. nmbd uses some quite smart internal queueing mechanisms to overcome the fact that it is a single process handling lots of simultaneous requests. It can't use this for gethostbyname() though. smbd on the other hand is a "fork for each connection" daemon (no exec involved, just a fork) so you see a new smbd for each client connected to your system. Cheers, Andrew -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Andrew Tridgell Dept. of Computer Science email: samba-bugs@samba.anu.edu.au Australian National University Phone: +61 6 254 8209 Fax: 61 6 249 0010 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-