[CentOS] Logrotate errors

2014-04-08 Thread C. L. Martinez
Hi all,

 I have a problem with logrotate and I don't know why. In
/var/log/messages appears these errors:

Apr  8 15:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 16:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 17:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 18:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 19:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 20:01:02 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 21:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 22:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
Apr  8 23:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]

It seems the problem if with this logrotate.conf (executed every hour):

create
dateext

/srv/www2/logs/viewer.log {
   size 512k
   create 0640 www www
   missingok
   rotate 7
   compress
   delaycompress
   copytruncate
   notifempty
}

Doing a debug:

[root@www02 ~]# logrotate /data/config/etc/logrotate.conf -dv
reading config file /data/config/etc/logrotate.conf
reading config info for /nsm/moloch/logs/viewer.log

Handling 1 logs

rotating pattern: /srv/www2/logs/viewer.log  524288 bytes (7 rotations)
empty log files are not rotated, old logs are removed
considering log /srv/www2/logs/viewer.log
  log needs rotating
rotating log /srv/www2/logs/viewer.log, log->rotateCount is 7
dateext suffix '-20140409'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /srv/www2/logs/viewer.log-20140409 already exists, skipping rotation

 According to this kb from redhat's website:

https://access.redhat.com/site/solutions/39006

 problem could be selinux. But SElinux is disabled:

[root@www02 ~]# sestatus
SELinux status: disabled
[root@www02 ~]#

 Any idea?? Could be a bug??

 Host is a CentOS 6.5 x86_64 fully patched.

Thanks.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Logrotate errors

2014-04-09 Thread John Doe
From: C. L. Martinez 

> destination /srv/www2/logs/viewer.log-20140409 already exists, skipping 
> rotation

I'd think logrotate does not expect to find an already existing "half-rotated" 
file?
Maybe this file is supposed to be compressed '.gz'?
Can you show "ls -l /srv/www2/logs/viewer.log*" ?

JD
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Logrotate errors

2014-04-10 Thread Marios Zindilis
Logrotate, by default, runs daily (not hourly) and renames the log files
that it rotates by appending to them the current date. In your case, you
are running it hourly, so it only runs successfully only once a day. The
second time that it will attempt to run in the same day, it will find that
there already exists a rotated file with the appended date for that same
day, and fail.

So, either run it daily, or change the renaming scheme.


On Wed, Apr 9, 2014 at 9:45 AM, C. L. Martinez  wrote:

> Hi all,
>
>  I have a problem with logrotate and I don't know why. In
> /var/log/messages appears these errors:
>
> Apr  8 15:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 16:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 17:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 18:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 19:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 20:01:02 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 21:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 22:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 23:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>
> It seems the problem if with this logrotate.conf (executed every hour):
>
> create
> dateext
>
> /srv/www2/logs/viewer.log {
>size 512k
>create 0640 www www
>missingok
>rotate 7
>compress
>delaycompress
>copytruncate
>notifempty
> }
>
> Doing a debug:
>
> [root@www02 ~]# logrotate /data/config/etc/logrotate.conf -dv
> reading config file /data/config/etc/logrotate.conf
> reading config info for /nsm/moloch/logs/viewer.log
>
> Handling 1 logs
>
> rotating pattern: /srv/www2/logs/viewer.log  524288 bytes (7 rotations)
> empty log files are not rotated, old logs are removed
> considering log /srv/www2/logs/viewer.log
>   log needs rotating
> rotating log /srv/www2/logs/viewer.log, log->rotateCount is 7
> dateext suffix '-20140409'
> glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
> glob finding logs to compress failed
> destination /srv/www2/logs/viewer.log-20140409 already exists, skipping
> rotation
>
>  According to this kb from redhat's website:
>
> https://access.redhat.com/site/solutions/39006
>
>  problem could be selinux. But SElinux is disabled:
>
> [root@www02 ~]# sestatus
> SELinux status: disabled
> [root@www02 ~]#
>
>  Any idea?? Could be a bug??
>
>  Host is a CentOS 6.5 x86_64 fully patched.
>
> Thanks.
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Marios Zindilis
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Logrotate errors

2014-04-10 Thread Steven Tardy
http://svn.fedorahosted.org/svn/logrotate/tags/r3-8-5/logrotate.8
shows "hourly" as a .conf option was added to 3.8.5...

current centos 6 version is logrotate-3.7.8-17.el6.x86_64

centos6$ man logrotate:
   dateformat format_string
  Specify  the extension for dateext using the notation similar
to
  strftime(3) function. Only  %Y  %m  %d  and  %s  specifiers
are
  allowed.

in your .conf try:
dateformat -%s



On Wed, Apr 9, 2014 at 2:45 AM, C. L. Martinez  wrote:

> Hi all,
>
>  I have a problem with logrotate and I don't know why. In
> /var/log/messages appears these errors:
>
> Apr  8 15:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 16:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 17:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 18:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 19:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 20:01:02 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 21:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 22:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
> Apr  8 23:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>
> It seems the problem if with this logrotate.conf (executed every hour):
>
> create
> dateext
>
> /srv/www2/logs/viewer.log {
>size 512k
>create 0640 www www
>missingok
>rotate 7
>compress
>delaycompress
>copytruncate
>notifempty
> }
>
> Doing a debug:
>
> [root@www02 ~]# logrotate /data/config/etc/logrotate.conf -dv
> reading config file /data/config/etc/logrotate.conf
> reading config info for /nsm/moloch/logs/viewer.log
>
> Handling 1 logs
>
> rotating pattern: /srv/www2/logs/viewer.log  524288 bytes (7 rotations)
> empty log files are not rotated, old logs are removed
> considering log /srv/www2/logs/viewer.log
>   log needs rotating
> rotating log /srv/www2/logs/viewer.log, log->rotateCount is 7
> dateext suffix '-20140409'
> glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
> glob finding logs to compress failed
> destination /srv/www2/logs/viewer.log-20140409 already exists, skipping
> rotation
>
>  According to this kb from redhat's website:
>
> https://access.redhat.com/site/solutions/39006
>
>  problem could be selinux. But SElinux is disabled:
>
> [root@www02 ~]# sestatus
> SELinux status: disabled
> [root@www02 ~]#
>
>  Any idea?? Could be a bug??
>
>  Host is a CentOS 6.5 x86_64 fully patched.
>
> Thanks.
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Logrotate errors

2014-04-10 Thread C. L. Martinez
Yep, Marios and Steven are right ... I have changed dateformat for one
log file and I have done another test changing time rotations ... And
all works ok.

Many thanks for your help.

On Fri, Apr 11, 2014 at 12:09 AM, Steven Tardy  wrote:
> http://svn.fedorahosted.org/svn/logrotate/tags/r3-8-5/logrotate.8
> shows "hourly" as a .conf option was added to 3.8.5...
>
> current centos 6 version is logrotate-3.7.8-17.el6.x86_64
>
> centos6$ man logrotate:
>dateformat format_string
>   Specify  the extension for dateext using the notation similar
> to
>   strftime(3) function. Only  %Y  %m  %d  and  %s  specifiers
> are
>   allowed.
>
> in your .conf try:
> dateformat -%s
>
>
>
> On Wed, Apr 9, 2014 at 2:45 AM, C. L. Martinez  wrote:
>
>> Hi all,
>>
>>  I have a problem with logrotate and I don't know why. In
>> /var/log/messages appears these errors:
>>
>> Apr  8 15:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 16:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 17:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 18:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 19:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 20:01:02 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 21:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 22:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>> Apr  8 23:01:01 plzfnsm02 logrotate: ALERT exited abnormally with [1]
>>
>> It seems the problem if with this logrotate.conf (executed every hour):
>>
>> create
>> dateext
>>
>> /srv/www2/logs/viewer.log {
>>size 512k
>>create 0640 www www
>>missingok
>>rotate 7
>>compress
>>delaycompress
>>copytruncate
>>notifempty
>> }
>>
>> Doing a debug:
>>
>> [root@www02 ~]# logrotate /data/config/etc/logrotate.conf -dv
>> reading config file /data/config/etc/logrotate.conf
>> reading config info for /nsm/moloch/logs/viewer.log
>>
>> Handling 1 logs
>>
>> rotating pattern: /srv/www2/logs/viewer.log  524288 bytes (7 rotations)
>> empty log files are not rotated, old logs are removed
>> considering log /srv/www2/logs/viewer.log
>>   log needs rotating
>> rotating log /srv/www2/logs/viewer.log, log->rotateCount is 7
>> dateext suffix '-20140409'
>> glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
>> glob finding logs to compress failed
>> destination /srv/www2/logs/viewer.log-20140409 already exists, skipping
>> rotation
>>
>>  According to this kb from redhat's website:
>>
>> https://access.redhat.com/site/solutions/39006
>>
>>  problem could be selinux. But SElinux is disabled:
>>
>> [root@www02 ~]# sestatus
>> SELinux status: disabled
>> [root@www02 ~]#
>>
>>  Any idea?? Could be a bug??
>>
>>  Host is a CentOS 6.5 x86_64 fully patched.
>>
>> Thanks.
>> ___
>> CentOS mailing list
>> CentOS@centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos