Hide Forgot
Description of problem: /etc/logrotate.d/mgetty contains: /var/log/mgetty.log.tty /var/log/mgetty.log.unknown /var/log/mgetty.callback Problem n.1: it should be mgetty.log.tty* instead of mgetty.log.tty Problem n.2: it should be mgetty.log.callback instead of mgetty.callback Version-Release number of selected component (if applicable): mgetty-1.1.36-13.fc17.src.rpm How reproducible: Always Steps to Reproduce n.1: 1. Start mgetty on ttyS0 2. See that /var/log/mgetty.log.ttyS0 is created 3. Run: logrotate -f /etc/logrotate.conf 4. See that log file is not rotated Steps to Reproduce n.2: 1. Run: callback 1234 2. See that /var/log/mgetty.log.callback is created 3. Run logrotate -f /etc/logrotate.conf 4. See that log file is not rotated Actual results: Log files not rotated Expected results: Log files rotated Additional info: I'm using CentOS and not Fedora, however I understand that CentOS is based on RHEL, which is based on Fedora, so I downloaded the latest mgetty src.rpm from Fedora rawhide and checked logrotate.mgetty; since the problem is still there I thought that the best thing is for it to be fixed in Fedora so that it will trickle down to CentOS some day.
Fixed in rawhide -> http://lists.fedoraproject.org/pipermail/scm-commits/2011-November/682315.html -> Modified
It seems there's a problem with the setup I proposed. I assumed (didn't understand the syntax) that the existing line tabooext + mgetty.log.tty*[-.]* at the beginning of the logrotate file was meant to protect against rotating already rotated logs, hence my proposal of mgetty.log.tty* However, I actually got log file rotated multiple times. So I looked up "tabooext" in the man page, and it seems it's meant to avoid reading in config files (ie: include directive) not to avoid processing files to be rotated. So, since I don't know how to solve this, for now I went back to the RHEL5 file, the one with the multiple /var/log/mgetty.log.tty[^.] /var/log/mgetty.log.tty[^.][^.] .....
I confirm that tabooext is intended to exclude config files from being loaded, not logfiles, so I think that enumerating the ttyXXX with all their possible length is probably the best workaround given the glob wildcard matching capabilities.
(In reply to comment #3) > I confirm that tabooext is intended to exclude config files from being loaded Agreed. Rotating of logs is indeed broken. I should have examined more, before committing a "fix". Since I don't use mgetty very often, I didn't realize it is actually broken. Sorry for that. > enumerating the ttyXXX with all their possible length is probably the best > workaround given the glob wildcard matching capabilities. This scheme works, but it is a completely horrible. We should have something better. I am not sure what would be the best approach here.
I think that best approach here would be changing naming scheme for mgetty log files. New filenames will be matched by following wildcard /var/log/mgetty.tty*.log. I will change it in F19 and in F18 I will use logrotate configuration from RHEL5.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
I have changed naming scheme of log files and adjusted logrotate configuration accordingly.