Bug 590610
| Summary: | Samba3x crashes when logfile rotation occurs | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Albert Flügel <albert.fluegel> |
| Component: | samba3x | Assignee: | Guenther Deschner <gdeschner> |
| Status: | CLOSED NOTABUG | QA Contact: | qe-baseos-daemons |
| Severity: | high | Docs Contact: | |
| Priority: | low | ||
| Version: | 5.6 | CC: | azelinka, dpal, ssorce |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-06-30 13:41:11 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Albert Flügel
2010-05-10 10:16:54 UTC
I cannot reproduce this (tried on i386 and x86_64), can you give some more details, what is the version of libtdb you are using ? Can you reproduce it at will (by calling "killall -HUP smbd") ? Also please upload your smb.conf file. Albert, can you give us any hint how to reproduce it please ? Hi, sorry i was on vacation. To reproduce the problem: cd /var/log/samba mv messages.tdb old/messages.tdb.0 # or whatever name you like Now initiate some new samba connection or perform any other action making smbd log into the messages file. The messages.tdb is not always rotated by logrotate it seems, so simply calling the log rotater is not sufficient to reproduce the problem. As soon as you see a recreated messages.tdb, you will see the core dump message in log.0.0.0.0 the libtdb version is libtdb-1.1.2-51.el5 Please try to reproduce the described way. I'd like to only upload the smbd.conf file, if unavoidable to see the problem. hope this helps. Oh, I see.
So, messages.tdb does *NOT* contain logging information but is an internal database that is used to store interprocess messaging information. It is illegal to remove it underneath running samba daemons. logrotate will and must never ever touch it.
Actually it can only happen if you have set "lock directory = /var/log/samba" smb.conf option. Have you set that ?
If so, can you try this patch?
--- /etc/logrotate.d/samba.orig 2010-06-30 12:40:02.863610180 +0200
+++ /etc/logrotate.d/samba 2010-06-30 12:40:08.749275101 +0200
@@ -1,4 +1,4 @@
-/var/log/samba/* {
+/var/log/samba/*.log {
notifempty
olddir /var/log/samba/old
missingok
The /etc/logrotate.d/samba came with samba3x-3.3.8-0.51.el5 and looks like this:
/var/log/samba/* {
notifempty
olddir /var/log/samba/old
missingok
sharedscripts
copytruncate
}
I added
> postrotate
> /etc/init.d/smb restart
> endscript
to work around the problem.
i think your patch will do the job and avoid rotating .tdb files. Can you confirm, that the .tdb files are not continuously growing ?
Thanks a lot !
Things are more or less like i suspected.
The reason why i opened the bug against samba3x is, that the logrotate.d/samba
file is part of the respective rpm.
erm, more log files to be rotated are
log.<ip-address>
... think your pattern is not sufficient.
Will try with
/var/log/samba/*.log /var/log/samba/log.* {
notifempty
olddir /var/log/samba/old
missingok
sharedscripts
copytruncate
}
(In reply to comment #9) > The /etc/logrotate.d/samba came with samba3x-3.3.8-0.51.el5 and looks like > this: > /var/log/samba/* { > notifempty > olddir /var/log/samba/old > missingok > sharedscripts > copytruncate > } > > I added > > > postrotate > > /etc/init.d/smb restart > > endscript > > to work around the problem. No, this workaround is really wrong as it kills your smbd during logrotate, including disconnects of all existing connections. > i think your patch will do the job and avoid rotating .tdb files. Can you > confirm, that the .tdb files are not continuously growing ? Usually they shouldn't, if you observe one to grow to a problematic degree, please open a new bug. Note that just copying an opened tdb file is the wrong way (and therefore logrotate cannot create working or usefull copies). For creating backups of tdbs, please use tdbbackup. (In reply to comment #10) > erm, more log files to be rotated are > log.<ip-address> > > ... think your pattern is not sufficient. > Will try with > > /var/log/samba/*.log /var/log/samba/log.* { > notifempty > olddir /var/log/samba/old > missingok > sharedscripts > copytruncate > } Yeah, depending on other options in your smb.conf file, other matching patterns need to be used. Really hard to match whatever is set in smb.conf :) I think we can close this as not a bug, as default setups will work just fine with logrotate. Thanks for the detailed report though! Sorry, i disagree. The .tdb files are matched by /var/log/samba/* and thus rotated, what will cause the core dump, so i consider the file pattern in /etc/logrotate.d/samba a bug. Albert, sorry but changing the lockdir directory in smb.conf to point to /var/log/samba (or symlinking /var/lib/samba to it) is not supported. All files in /var/log/samba/ are considered log files and they are all rotated without discrimination on purpose. We consider this a configuration mistake and not a bug, sorry. |