You are not logged in.

#1 2014-12-06 10:59:19

Echinos
Member
From: Poland
Registered: 2011-12-01
Posts: 16

Logrotate won't rotate Exim logs

There's a problem with rotating Exim logs on my server. Probably I broke something and I don't know how to fix this. Please help.

Output from journalctl:

gru 05 13:01:29 ### logrotate[174]: error: error renaming /var/log/archive/mainlog.4 to /var/log/archive/mainlog.5: Brak dostępu
gru 05 13:01:29 ### logrotate[174]: error: error renaming /var/log/archive/rejectlog.4 to /var/log/archive/rejectlog.5: Brak dostępu

(Brak dostępu = permission (access?) denied
The mainlog.4 and rejectlog.4 files are not exists right now because I deleted everything and I tried to set things from begining.

~ % ls /var/log -clt | grep archive/                                                                                                    :(
drwxrwx---  2 root log                4096 12-05 13:01 archive/
~ % groups exim
log exim
~ % cat /etc/logrotate.d/exim
/var/log/exim/*log {
   su exim exim
   missingok
   notifempty
   delaycompress
}

Other logs are rotated with no issues.

Last edited by Echinos (2015-01-26 16:36:09)

Offline

#2 2014-12-06 12:07:48

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Logrotate won't rotate Exim logs

Did you delete .4 after or before the error? You could try `sudo -u exim mv /var/log/archive/mainlog.4 /var/log/archive/mainlog.5` to check if its a logrotate or a permission issue

Offline

#3 2014-12-06 12:29:36

Echinos
Member
From: Poland
Registered: 2011-12-01
Posts: 16

Re: Logrotate won't rotate Exim logs

After your reply i think I found the solution.
I have executed

sudo logrotate -f -v /etc/logrotate.conf

and my logifile was rotated properly.

rotating pattern: /var/log/exim/*log  forced from command line (4 rotations)
olddir is /var/log/archive, empty log files are not rotated, old logs are removed
switching euid to 79 and egid to 79
considering log /var/log/exim/mainlog
  log needs rotating
considering log /var/log/exim/rejectlog
  log needs rotating
rotating log /var/log/exim/mainlog, log->rotateCount is 4
dateext suffix '-20141206'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/archive/mainlog.4 to /var/log/archive/mainlog.5 (rotatecount 4, logstart 1, i 4),
old log /var/log/archive/mainlog.4 does not exist
renaming /var/log/archive/mainlog.3 to /var/log/archive/mainlog.4 (rotatecount 4, logstart 1, i 3),
old log /var/log/archive/mainlog.3 does not exist
renaming /var/log/archive/mainlog.2 to /var/log/archive/mainlog.3 (rotatecount 4, logstart 1, i 2),
old log /var/log/archive/mainlog.2 does not exist
renaming /var/log/archive/mainlog.1 to /var/log/archive/mainlog.2 (rotatecount 4, logstart 1, i 1),
old log /var/log/archive/mainlog.1 does not exist
renaming /var/log/archive/mainlog.0 to /var/log/archive/mainlog.1 (rotatecount 4, logstart 1, i 0),
old log /var/log/archive/mainlog.0 does not exist
log /var/log/archive/mainlog.5 doesn't exist -- won't try to dispose of it
renaming /var/log/exim/mainlog to /var/log/archive/mainlog.1
creating new /var/log/exim/mainlog mode = 0640 uid = 79 gid = 79
rotating log /var/log/exim/rejectlog, log->rotateCount is 4
dateext suffix '-20141206'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/archive/rejectlog.4 to /var/log/archive/rejectlog.5 (rotatecount 4, logstart 1, i 4),
old log /var/log/archive/rejectlog.4 does not exist
renaming /var/log/archive/rejectlog.3 to /var/log/archive/rejectlog.4 (rotatecount 4, logstart 1, i 3),
old log /var/log/archive/rejectlog.3 does not exist
renaming /var/log/archive/rejectlog.2 to /var/log/archive/rejectlog.3 (rotatecount 4, logstart 1, i 2),
old log /var/log/archive/rejectlog.2 does not exist
renaming /var/log/archive/rejectlog.1 to /var/log/archive/rejectlog.2 (rotatecount 4, logstart 1, i 1),
old log /var/log/archive/rejectlog.1 does not exist
renaming /var/log/archive/rejectlog.0 to /var/log/archive/rejectlog.1 (rotatecount 4, logstart 1, i 0),
old log /var/log/archive/rejectlog.0 does not exist
log /var/log/archive/rejectlog.5 doesn't exist -- won't try to dispose of it
renaming /var/log/exim/rejectlog to /var/log/archive/rejectlog.1
creating new /var/log/exim/rejectlog mode = 0640 uid = 79 gid = 79
switching euid to 0 and egid to 0

Before that, I tried with -d -f (debug, force) option but I see that changes is not made with -d switch.

Offline

#4 2015-01-26 16:40:12

Echinos
Member
From: Poland
Registered: 2011-12-01
Posts: 16

Re: Logrotate won't rotate Exim logs

Unfortunately the problem still occurs.

sty 25 00:00:16 XXX logrotate[20719]: error: error renaming /var/log/archive/mainlog.4 to /var/log/archive/mainlog.5: Brak dostępu
sty 25 00:00:16 XXX logrotate[20719]: error: error renaming /var/log/archive/rejectlog.4 to /var/log/archive/rejectlog.5: Brak dostępu

If I run

sudo -u exim mv /var/log/archive/mainlog.4 /var/log/archive/mainlog.5

the file is moved properly with no error.

What can I do next?

Last edited by Echinos (2015-01-26 16:41:30)

Offline

Board footer

Powered by FluxBB