Bug 1182073

Summary: [3.5-6.6] logrotate fails to operate correctly / misses to rotate logfiles
Product: Red Hat Enterprise Virtualization Manager Reporter: haiyang,dong <hadong>
Component: ovirt-nodeAssignee: Fabian Deutsch <fdeutsch>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.0CC: cshao, ecohen, gklein, gouyang, hadong, huiwa, iheim, leiwang, lsurette, ycui, ylavi
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: node
Fixed In Version: ovirt-node-3.2.1-5.el6 ovirt-node-3.2.1-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 21:08:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1164311    

Description haiyang,dong 2015-01-14 11:39:14 UTC
Description of problem:
Due to execute "logrotate -f /etc/logrotate.d/syslog" for the second time failed:
[root@hp-z600-04 mnt]# logrotate -f /etc/logrotate.d/syslog 
[root@hp-z600-04 mnt]# logrotate -f /etc/logrotate.d/syslog 
error: stat of /var/log/cron failed: No such file or directory
error: stat of /var/log/maillog failed: No such file or directory
error: stat of /var/log/secure failed: No such file or directory
error: stat of /var/log/spooler failed: No such file or directory

so the /var/log/message was logroated failed.


Version-Release number of selected component (if applicable):
rhev-hypervisor6-6.6-20150112.0
ovirt-node-3.1.0-0.42.20150109gitd06b7c5.el6.noarch

How reproducible:
100%

Steps to Reproduce:

Actual results:


Expected results:

Additional info:
[root@dhcp-10-54 admin]# cat /etc/logrotate.d/syslog 
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
    sharedscripts
    rotate 5
    size 15M
    compress
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

Comment 1 Fabian Deutsch 2015-01-14 12:00:47 UTC
The effect is that with tthose errors in place, also other log files (like messages) are not rotated.

Comment 2 Yaniv Lavi 2015-01-14 13:53:43 UTC
Small fix and low risk. I understand this can be included in RC without delaying it, so setting this a RC target.

Comment 4 haiyang,dong 2015-01-20 05:27:52 UTC
Test version:
rhev-hypervisor6-6.6-20150119.0.1.iso
ovirt-node-3.2.1-5.el6.noarch

Test steps:
1. [root@dhcp-66-73-174 log]# ls -al messages 
-rw-------. 1 root root 76482 2015-01-20 05:07 messages

2. [root@dhcp-66-73-174 log]# cat /etc/logrotate.d/syslog 
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
    sharedscripts
    rotate 5
    size 15M
    compress
    missingok
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}
              
3. [root@dhcp-66-73-174 log]# logrotate -f /etc/logrotate.d/syslog 

4. [root@dhcp-66-73-174 log]# ls -al messages
-rw-------. 1 root root 148 2015-01-20 05:08 messages

5. [root@dhcp-66-73-174 log]# dd if=/dev/zero of=messages bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 4.44515 s, 23.6 MB/s

6. [root@dhcp-66-73-174 log]# ls -al messages
-rw-------. 1 root root 104857600 2015-01-20 05:09 messages

7. [root@dhcp-66-73-174 log]# logrotate -f /etc/logrotate.d/syslog 

8. [root@dhcp-66-73-174 log]# ls -al messages
-rw-------. 1 root root 148 2015-01-20 05:09 messages

Test result:
Executed "logrotate -f /etc/logrotate.d/syslog" for the second time successfully, also the /var/log/message was logroated.

so this bug has been fixed, after the status changed into "ON_QA", I will verify this bug.

Comment 6 haiyang,dong 2015-01-28 11:25:51 UTC
According to Comment 4, changed the status into "VERIFIED".

Comment 8 errata-xmlrpc 2015-02-11 21:08:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-0160.html