Logfiles grow much bigger than they should

Mattias Gronlund Mattias.Gronlund at sa.erisoft.se
Sat Jun 12 14:53:10 GMT 1999


Hi,

We just noticed that there is a problem with samba and it's log-files. There is a
function called "check_log_size" that starts with:

  if( debug_count++ < 100 || geteuid() != 0 )
    return;

And it just happens  that some (a lot?) debug-messages get written with
euid != 0. For example:

[1999/06/12 15:29:04.514423, 0, 24668] lib/util_sock.c:write_data(416)
  write_data: write failure. Error = Disc quota exceeded

We are using the default max-size of 5000KB for log-files. But our current
log-sizes is:
-rw-r--r--   1 root     root      355703 Jun 12 16:22 /var/log/log-180.smb
-rw-r--r--   1 root     root     12557626 Jun 11 18:15 /var/log/log-180.smb.old

and I have seen MUCH larger ones.

There is also a problem with the log-switching, We have a server with 29
smbd-processes that writes an unlinked logfile. The log-file has been
switched two times and some processes has newer followed the change.

I don't have all that insigt in the Samba-source, for finding the right solution
for the problem, so I would be happy if someone could give me a hint on
which way to go for solving this problem.

I think that one sulotion could be to change the to not change the log-file
in the debug-call-chain, but insted set a flag that tha main loop could
check for. The main-loop then could in a controlled way switch user to
root to switch-log. It would also make it easyer to let the main-loop
check the log-size say every 5 minits or so. This would also make
idle (non log-writing) smbds to switch log (so the diskspace can be
returned when unlinked).

I didn't get any answers for my last mail, so if this is the wrong place
for this type of discussion please feel free to tell me.

/Mattias




More information about the samba-technical mailing list