[Samba] If we use vfork, can the smbd and nmbd work rightly?
jra at samba.org
Thu Jan 8 17:26:05 GMT 2009
On Thu, Jan 08, 2009 at 09:37:40AM +0100, Volker Lendecke wrote:
> On Thu, Jan 08, 2009 at 02:51:55PM +0800, shrek wu wrote:
> > I has been trying to port the Samba package to uClinux. But our uClinux
> > toolchain doesn't support the fork() call.
> > I must replace the fork with vfork.If we use vfork, the smbd and nmbd can
> > not work rightly.
> > both samba-3.0.32 and samba-3.0.2a have the question.
> > In samba/source/smbd/server.c, the function open_sockets_smbd(), creates a
> > child process and a parent process.
> > Both these functions need to do different tasks in smbd at about the same
> > time.
> > The call to vfork() creates a child process and blocks the parent process,
> > but vfork() differs from fork() in that the parent is suspended until the
> > child makes a call to execve(2) or _exit(2).
> > So we replaced the fork with vfork in samba, smbd and nmbd can not work
> > rightly.
> > Had somebody let the smbd and nmbd can work using vfork()?
> > What I can do let the smbd and nmbd can work using vfork()?
> The easy way for smbd would be to let it run in inetd mode
> and have inetd do the vfork call. nmbd except for being a
> wins server with "dns proxy = yes" should not fork at all
> after having become a daemon.
You'll also have to fix various fork() calls within smbd
for the async printer queue loading and async printcap
CUPS loading (disable them). If you're not serving printers
this will be easier.
More information about the samba