Bug 113764
| Summary: | Logrotate does not 'mailfirst' | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | David Tonhofer <bughunt> |
| Component: | logrotate | Assignee: | Elliot Lee <sopwith> |
| Status: | CLOSED DUPLICATE | QA Contact: | David Lawrence <dkl> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i686 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2006-02-21 19:00:48 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: | |||
This has since been fixed - grab the Fedora Core 1 logrotate if you want a fix, and see #100546 for details. *** This bug has been marked as a duplicate of 100546 *** Changed to 'CLOSED' state since 'RESOLVED' has been deprecated. |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Description of problem: I have the situation where logrotate does not mail the file-about-to-be-rotated under RH9.0 ('mailfirst'), though an identical setup works under RH7.3. Here's a logrotate block in "/etc/logrotate.d/httpd" on the RH9.0 system, which does not mail (N.B. there are other blocks in the same /etc/logrotate.d/httpd file): ------------------------------------------- /var/log/httpd/error_log { daily rotate 65 nomissingok ifempty olddir /var/log/httpd/error_dir create 640 root mpfyrun mail zaibatsu mailfirst compress delaycompress postrotate /usr/local/apache2/bin/apachectl graceful # there will be some activity on the saved log, so don't # compress # if you want to compress, sleep for 600 or use delaycompress # echo "Rotated httpd error_log" endscript } ------------------------------------------- Logrotate has the following /etc/logrotate.conf file: ------------------------------------------- less /etc/logrotate.conf # see "man logrotate" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp -- we'll rotate them here /var/log/wtmp { monthly create 0664 root utmp rotate 1 } # system-specific logs may be also be configured here. ------------------------------------------- The same block works under RH7.3 (i.e. it mails). For the RH7.3 case, the logrotate.conf is identical. The solution was to add a preprotate entry, like so: prerotate /usr/local/mplify/sbin/check_httpd_error_log.pl < /var/log/httpd/error_log 2>&1 | mail -s "SYSOP: `hostname`/HTTPd error log" techies endscript Another block for mysql using 'mailfirst' works under RH9.0. Here it is: ---------------------------------------- /var/log/mysql/error_log { daily rotate 30 nomissingok notifempty nocreate mailfirst olddir /var/log/mysql/error_dir mail techies copytruncate postrotate chown mysql.mysql /var/log/mysql/error_log chmod 660 /var/log/mysql/error_log # echo "Rotated the myslq error_log" endscript } ---------------------------------------- Version-Release number of selected component (if applicable): logrotate-3.6.8-1 How reproducible: Didn't try Actual Results: The file-about-to-be-rotated-away does not arrive in the inbox Expected Results: The file-about-to-be-rotated-away should arrive in the inbox Additional info: