[patch] SIGHUP reload problem

Guy Thornley guyat at voyager.co.nz
Sat Feb 13 16:08:55 GMT 1999


Before I start, can anyone give me details on the samba-bugs list?
This belongs on there, however I couldnt find subscription details on 
www.samba.org. I am also new here. (so please dont flame if this isnt
wanted, just say so and i'll go away)

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.]

This was easily replicated by making a guest ok=yes printer type
share, connecting to it with smbclient and leaving it connected with
no activity.

The attached patch fixes this problem. It causes the server process
[when smbd is started as a daemon] to spawn a child that only sends it
SIGHUP once in a while. The server then propogates this signal to
its children. The select_timeout is forced to 0, and if there is
enough traffic to stop the select() timing out, another SIGHUP signal
forces the idle code to be run.

Please note that this is my First Patch Ever, but it does good things
for me at least, so if someone could please stress it and tell me
where it fell over it would be great. :)

There is one known problem: a loop like:
	bash# while : ; do kill -1 <pid_of_smbd> ; done
will for some reason cause the connections to be lost fairly quickly.
(Within a second in my testing here). However, a for loop sending 100
signals wasnt able to kill it.

This has NOT been tested when smbd is started from inetd. It should
not have any effect on this (other than 2 SIGHUP's in quick succession
causing a reload properly - one SIGHUP will *not* work).

Oh - many many congrats on fine work with the domain membership in
samba 2.0.2 - it is brilliant and working a charm.


Guy Thornley                                             guyat at usa.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 1994 bytes
Url : http://lists.samba.org/archive/samba-technical/attachments/19990214/c289ac36/attachment.obj

More information about the samba-technical mailing list