Jonathan Knight
2002-Jul-02 02:54 UTC
[Samba] Major samba load caused by re-reading of the configuration file
We're running samba-2.2.3a-6 from the redhat 7.3 distribution. Periodically we see a massive load on our server which then quickly goes away. I've spent some time trying to diagnose where the problem is and it appears to be caused by every smb process on the machine (all 360 of them) re-reading the config file at the same moment. THe problem is I cannot see why this should happen and why it should happen every few minutes. The config file remains static so it isn't detecting a change there and as far as I can see there should be no reason for the samba processes to work in sync which each other. Before I delve into the code to try and find the problem I thought I'd email and run it pass the list in case it has already been spotted and fixed. The effect can be seen from this sample of the strace output I captured. I'll annoted what I can understand... ******** These SIGUSR1's seem to turn up regualarly so I assume ******** that they are normal and nothing to worry about. --- SIGUSR1 (User defined signal 1) --- write(21, "\1", 1) = 1 sigreturn() = ? (mask now [FPE USR2 PIPE]) read(20, "\1", 1) = 1 fcntl64(7, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=604, len=1}, 0xbffff430) = 0 fcntl64(7, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=14544, len=1}, 0xbffff3d0) = 0 fcntl64(7, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=14544, len=1}, 0xbffff3d0) = 0 fcntl64(7, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=164, len=1}, 0xbffff350) = 0 fcntl64(7, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=164, len=1}, 0xbffff360) = 0 fcntl64(7, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=604, len=1}, 0xbffff440) = 0 fcntl64(7, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=604, len=1}, 0xbffff430) = 0 fcntl64(7, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=604, len=1}, 0xbffff440) = 0 ******** Here's where the problem lies. The select call has ******** timed out (this smb was idle so that's no surprise) ******** but why does it then go off and read its three config ******** files again? select(21, [4 19 20], NULL, NULL, {60, 0}) = 0 (Timeout) time(NULL) = 1025600343 time(NULL) = 1025600343 geteuid32() = 0 write(22, "[2002/07/02 09:59:03, 3] smbd/se"..., 57) = 57 geteuid32() = 0 write(22, " setting sec ctx (0, 0) - sec_c"..., 49) = 49 geteuid32() = 0 getegid32() = 0 setgroups32(0, 0) = 0 setresgid32(0xffffffff, 0, 0xffffffff) = 0 getegid32() = 0 setresuid32(0xffffffff, 0, 0xffffffff) = 0 geteuid32() = 0 stat64("", 0xbfffed50) = -1 ENOENT (No such file or directory) umask(022) = 0 open("/var/log/samba/log.smb", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 23fstat64(23, {st_mode=S_IFREG|0644, st_size=419681, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000 fstat64(23, {st_mode=S_IFREG|0644, st_size=419681, ...}) = 0 _llseek(23, 419681, [419681], SEEK_SET) = 0 munmap(0x40016000, 4096) = 0 close(22) = 0 umask(0) = 022 stat64("/etc/samba/conf/printers/smb.printers.admin.conf", {st_mode=S_IFREG|0644, st_size=2955, ...}) = 0 stat64("/etc/samba/conf/smb.bumble.conf", {st_mode=S_IFREG|0644, st_size=10158, ...}) = 0 stat64("/etc/samba/smb.conf", {st_mode=S_IFREG|0644, st_size=534, ...}) = 0 time(NULL) = 1025600343 geteuid32() = 0 fstat64(23, {st_mode=S_IFREG|0644, st_size=419681, ...}) = 0 write(23, "[2002/07/02 09:59:03, 3] param/l"..., 61) = 61 geteuid32() = 0 write(23, " Initialising global parameters"..., 33) = 33 open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = 22 fstat64(22, {st_mode=S_IFREG|0644, st_size=534, ...}) = 0 read(22, "[global]\n\n server string = S"..., 534) = 534 close(22) = 0 time(NULL) = 1025600343 geteuid32() = 0 write(23, "[2002/07/02 09:59:03, 3] param/p"..., 56) = 56 geteuid32() = 0 write(23, " params.c:pm_process() - Proces"..., 78) = 78 time(NULL) = 1025600343 geteuid32() = 0 write(23, "[2002/07/02 09:59:03, 3] param/l"..., 59) = 59 geteuid32() = 0 write(23, " Processing section \"[global]\"\n", 32) = 32 getpid() = 21211 time(NULL) = 1025600343 geteuid32() = 0 write(23, "[2002/07/02 09:59:03, 1] lib/deb"..., 56) = 56 getpid() = 21211 geteuid32() = 0 write(23, " INFO: Debug class all level = "..., 63) = 63 stat64("/etc/samba/conf/smb.%h.conf", 0xbfffe3d0) = -1 ENOENT (No such file or directory) stat64("/etc/samba/conf/smb.bumble.conf", {st_mode=S_IFREG|0644, st_size=10158, ...}) = 0 open("/etc/samba/conf/smb.bumble.conf", O_RDONLY|O_LARGEFILE) = 22 fstat64(22, {st_mode=S_IFREG|0644, st_size=10158, ...}) = 0 read(22, ";++++++++++++++++++++++++++++++\n"..., 10158) = 10158 close(22) = 0 time(NULL) = 1025600343 geteuid32() = 0 write(23, "[2002/07/02 09:59:03, 3] param/p"..., 56) = 56 geteuid32() = 0 write(23, " params.c:pm_process() - Proces"..., 90) = 90 .... and so on. We do make use of include directives in the smb.conf file see the extracted section below... [global] server string = Samba Server printcap name = /etc/printcap load printers = yes printing = lprng log file = /var/log/samba/log.smb log level = 3 max log size = 1000000 password level = 4 security = user smb passwd file = /etc/samba/smbpasswd socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 domain logons = yes wins support = yes wins proxy = yes dns proxy = yes include = /etc/samba/conf/smb.%h.conf This machine is "bumble" and its smb.bumble.conf file looks like this ;++++++++++++++++++++++++++++++ ; Global ;++++++++++++++++++++++++++++++ [global] workgroup = ADMIN netbios aliases = AURORA wins server wins support = yes logon script = %h.bat server string = SMB server for admin include = /etc/samba/conf/printers/smb.printers.admin.conf So taking a wild guess at the problem the smb is getting confused about the daisy chained config files and coming to the conclusion that they have been changed. Anybody seen this before? I'll happily volunteer to go and find the bug if this is something new. -- ______ jonathan@cs.keele.ac.uk Jonathan Knight, / Department of Computer Science / _ __ Telephone: +44 1782 583437 University of Keele, Keele, (_/ (_) / / Fax : +44 1782 713082 Staffordshire. ST5 5BG. U.K.
We are just about to start investigation into using LDAP and Samba as a means for unified user authentication. I was just wondering what flavours of LDAP people are using and what they think of them. Jethran Waugh Computer Officer School of Engineering and Applied Science Aston University +44 (0)121 359 3611 ext 4655