[patch] SIGHUP reload problem

Guy Thornley guyat at usa.net
Wed Feb 17 11:18:45 GMT 1999

Hello again

On Wed, 17 Feb 1999, Jeremy Allison wrote:

> > I tried samba-2.0.2 recently, on both a Linux 2.0.32/libc5
> > and a Linux 2.2.1+raid-0.9/glibc2 based system. Both times there was a
> > SIGHUP reload problem, where the SIGHUP would be recognised but not
> > acted upon. Also, the server process doesnt propogate SIGHUP to its
> > children. These bugs make any day-to-day administration a nightmare.
> > (Requiring users to reconnect to see permission/print command changes)
> > 
> > The problem is in the smbd/process.c file in the smbd_process()
> > function, where even moderate traffic on the open connection would
> > prevent the select() from timing out and causing the idle code to be
> > run. [This would also suggest there was no echo packets being sent
> > from the client to the server.]
> Guy,
> 	Can you try this patch instead of the one you
> kindly posted. This patch is somewhat simpler in that
> it requires no forked child.
Aye, I didnt like the thought of that very much; but SIGALRM appeared
to be used for NIS/DNS timeout stuff (just a quick grep of the source)
and the manpage says sleep() my use SIGALRM, so I decided against

> All it does is ensures that timeout processing is
> done every SELECT_TIMEOUT seconds - via an smb counter
> that causes a check to see if it's time to do timeout
> processing every 200 smb requests. This patch is against
> Samba 2.0.2.
I considered this solution also, but think of a low traffic persistent
connection; like dozeNT connected to a printer service...

> Let me know if this fixes the problem for you.
> Cheers,
> 	Jeremy Allison,
> 	Samba Team.

(patch snipped)

Thanks for that patch to try. Unfortunatly, my suspicions appear to
be well founded (for printer services at least). It hasnt reloaded the
configuration yet tonight.

More info on highlighting the problem. smbd on local machine with this

  guest ok=yes
  print command=echo "s=%s f=%f" >> /tmp/sambaprinttest

Connect to it with smbclient. Log shows an entry like:
  [1999/02/17 22:45:41, 1] smbd/service.c:make_connection(488)
    planet-z ( connect to service lp as user nobody (uid=65534, gid=100) (pid 8080)

Now edit the service so the printcommand redirects to
/tmp/sambaprinttest2 instead. Send all smbd's a HUP. (you may consider
the propogation of sighup to children, HPUX's killall is different to
linux's. But then again I probably dont know the right tool.)

Print something using the connected smbclient, it still goes to
/tmp/sambaprinttest . hmm.... printed /etc/hosts a few times, no joy,
printing of these didnt cause a reload either:

  -rw-r--r--   1 quantum  quantum   4102915 Feb  1 19:38 gv.pcl
  -rw-r--r--   1 quantum  quantum    309856 Jun 21  1997 gv.ps

I would test this over a peice of wire, cept my parents dont let me
have 2 computers going at once :( Next week, though, I am back at uni
accomodation and will blast stuff over 10b2 with glee....

Note that I am only testing with printer services, as this is how I
originally noticed the problem. However, there *may* also be this
lack-of-reload problem with new services not being loaded when an nt
client is connected and browsing the server also. (something I noticed
at work). Dont quote me on that last one, though.


Guy Thornley                                             guyat at usa.net

More information about the samba-technical mailing list