Bug 1019676

Summary: server log should be added to logrotate
Product: Red Hat Enterprise Virtualization Manager Reporter: Ohad Basan <obasan>
Component: ovirt-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED NOTABUG QA Contact: Pavel Stehlik <pstehlik>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, bazulay, eedri, iheim, obasan, Rhev-m-bugs, sbonazzo, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-18 11:30:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ohad Basan 2013-10-16 08:52:19 UTC
Description of problem:
/var/log/ovirt-engine/server.log can get to really large files (mine got to several GBs)
when installing ovirt engine, an entry for server.log should be added to logrotate

Comment 1 Sandro Bonazzola 2013-10-17 06:21:11 UTC
(In reply to Ohad Basan from comment #0)
> Description of problem:
> /var/log/ovirt-engine/server.log can get to really large files (mine got to
> several GBs)
> when installing ovirt engine, an entry for server.log should be added to
> logrotate

Looking at the code a logrotate entry for server.log is already in place.
Can you run as root:

 # logrotate -f /etc/logrotate.conf

and see if it fails?

Comment 2 Ohad Basan 2013-10-17 07:42:20 UTC
it does not fail.
which file should be in place?
in the logrotate.conf I have this
/var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

Comment 3 Sandro Bonazzola 2013-10-17 07:47:59 UTC
(In reply to Ohad Basan from comment #2)
> it does not fail.
> which file should be in place?

look at /etc/logrotate.d/ovirt-engine

> in the logrotate.conf I have this
> /var/log/wtmp {
>     monthly
>     create 0664 root utmp
>         minsize 1M
>     rotate 1
> }
> 
> /var/log/btmp {
>     missingok
>     monthly
>     create 0600 root utmp
>     rotate 1
> }

Comment 4 Sandro Bonazzola 2013-10-17 07:49:34 UTC
(In reply to Sandro Bonazzola from comment #3)
> (In reply to Ohad Basan from comment #2)
> > it does not fail.
> > which file should be in place?
> 
> look at /etc/logrotate.d/ovirt-engine
> 
> > in the logrotate.conf I have this
> > /var/log/wtmp {
> >     monthly
> >     create 0664 root utmp
> >         minsize 1M
> >     rotate 1
> > }
> > 
> > /var/log/btmp {
> >     missingok
> >     monthly
> >     create 0600 root utmp
> >     rotate 1
> > }

don't you have the following line?

include /etc/logrotate.d

Comment 5 Ohad Basan 2013-10-18 10:12:37 UTC
I have a guess about why it happens.
I just don't know what it started right now
the problem is that the automation env is repeatedly installs and reinstalls rhevm
when it installs rhev the logrotate entry is being written
when it removes rhev > the logrotate entry is being deleted
I think that when anacron runs the daily logrotate, rhev is not currently installed and therfore the logrotate entry is absent from the machine.
can you tell me if it's a new change ? meaning, in the past did yum remove rhev did NOT remove the logrotate entry from logrotate.d?

Comment 6 Sandro Bonazzola 2013-10-18 11:30:25 UTC
Log rotate files were introduced on Tue May 21, previoulsy the enigne used its own implementation for rotating logs. See http://gerrit.ovirt.org/#/c/14961/

I think you should call logrotate -f /etc/logrotate.conf before cleaning up or just after rpm install. Or just add a new file in your logrotate.d taking care of this.

Closing as this is not a bug.