Description of problem: Recently, the default "log file" setting in smb.conf was changed from "/var/log/samba/%m.log" to "/var/log/samba/log.%m". /etc/logrotate.d/samba now specifies "log.*" as well. Problem is, the "log.*" pattern doesn't exclude files that have already been rotated, causing log.smb.1.gz to become log.smb.1.gz.1.gz, etc. I believe this is a reoccurrence of bug #12832. Version-Release number of selected component (if applicable): samba-3.0.25a-3.fc7 How reproducible: Always? Steps to Reproduce: On a machine that has been running Samba for several weeks, take a look at the /var/log/samba directory: -rw-r--r-- 1 root root 2655 Jun 23 18:30 log.smbd -rw-r--r-- 1 root root 205 Jun 11 04:49 log.smbd.1.gz.1.gz Actual results: As you can see, it took an already-rotated log.smbd.1.gz file and re-rotated and re-gzipped it. (Note: I have compression enabled in /etc/logrotate.conf.) Expected results: It shouldn't re-rotate already-rotated log files. Switching back to a "%m.log" naming scheme would fix this.
This bug also causes me to get an e-mail from the logrotate cron job every Sunday: /etc/cron.daily/logrotate: error: error opening /var/log/samba/log.machine.4.gz: No such file or directory And here's what my /var/log/samba directory looks like after 5 weeks: -rw-r--r-- 1 root root 0 Jul 6 04:49 log.0.0.0.0 -rw-r--r-- 1 root root 0 Jul 8 05:00 log.0.0.0.0.1.1 -rw-r--r-- 1 root root 146 Jul 8 05:00 log.0.0.0.0.1.1.1 -rw-r--r-- 1 root root 0 Jul 7 04:49 log.0.0.0.0.1.gz -rw-r--r-- 1 root root 164 Jul 7 04:49 log.0.0.0.0.1.gz.1.gz -rw-r--r-- 1 root root 0 Jul 8 05:00 log.0.0.0.0.2.gz.1 -rw-r--r-- 1 root root 163 Jul 8 05:00 log.0.0.0.0.2.gz.1.1 -rw-r--r-- 1 root root 0 Jul 1 05:00 log.0.0.0.0.3.gz ... -rw-r--r-- 1 root root 746 Jul 8 10:59 log.machine -rw-r--r-- 1 root root 28453 Jul 8 05:00 log.machine.1 -rw-r--r-- 1 root root 0 Jul 8 05:00 log.machine.1.1 -rw-r--r-- 1 root root 48104 Jul 8 05:00 log.machine.1.1.1 -rw-r--r-- 1 root root 1042 Jun 10 05:00 log.machine.5.gz -rw-r--r-- 1 root root 51211 Jul 4 17:02 log.machine.old ... -rw-r--r-- 1 root root 3512 Jul 6 11:29 log.nmbd -rw-r--r-- 1 root root 345 Jun 10 05:00 log.nmbd.5.gz -rw-r--r-- 1 root root 3876 Jul 6 11:23 log.smbd -rw-r--r-- 1 root root 205 Jun 11 04:49 log.smbd.1.gz.1.gz -rw-r--r-- 1 root root 0 Jun 11 04:49 log.smbd.5.gz
Ping? This obvious regression is still present despite three updates to the Samba packages for F7. The fix, again, is to revert to the naming scheme used previously: - in /etc/samba/smb.conf, change "log.%m" to "%m.log" - in /etc/logrotate.d/samba, change "log.*" to "*.log"
The fix proposed in Comment #2 seems to work only for machine-specific logs. I have log.smbd, log.nmbd, and log.swat that don't seem to be affected by the % m.log directive; they all suffer from the recursive log numbering syndrome. Not sure if these paths are compiled into the binaries.
Found the solution, I am adding an /var/log/samba/old/ directory to hold rotated logs. This will solve the problem and also keep the main log dir a bit more clean.
samba-3.0.26a-3.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update samba'
Thanks, looks like that does indeed solve the problem.
samba-3.0.26a-6.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update samba'
samba-3.0.26a-6.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.