FS#29115 - [exim] logrotate fails to move logs

Attached to Project: Community Packages
Opened by x33a (x33a) - Sunday, 25 March 2012, 19:21 GMT
Last edited by Dave Reisner (falconindy) - Monday, 26 March 2012, 03:14 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

logrotate failed to move the exim log files to the old logs folder.

I got this message from the logrotate cronjob

error: failed to rename /var/log/exim/mainlog to /var/log/archive/mainlog.1: Permission denied
error: failed to rename /var/log/exim/paniclog to /var/log/archive/paniclog.1: Permission denied

Permissions on those files are:

# ls -l /var/log/exim/
total 8
-rw-r----- 1 exim exim 2921 Mar 25 20:46 mainlog
-rw-r----- 1 exim exim 208 Mar 21 18:59 paniclog

Additional info:
* package version(s)

exim 4.77-3
logrotate 3.8.1-1
This task depends upon

Closed by  Dave Reisner (falconindy)
Monday, 26 March 2012, 03:14 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#25094 
Comment by Dave Reisner (falconindy) - Sunday, 25 March 2012, 19:29 GMT
Does /var/log/archive exist, and does the exim user have write permissions for it?
Comment by x33a (x33a) - Monday, 26 March 2012, 02:09 GMT
/var/log/archive exists, but it's permissions are

# ls -ld /var/log/archive/
drwxr-xr-x 2 root root 4096 Mar 25 20:46 /var/log/archive/

In the /etc/logrotate.d/exim

/var/log/exim/*log {
su exim exim
missingok
notifempty
delaycompress
}

is the su line necessary? If it's not there then won't it run as root and work fine?
Comment by Dave Reisner (falconindy) - Monday, 26 March 2012, 02:12 GMT
necessary? I have no idea, but it's because /var/log/archive is owned by root:root that it fails. Nothing wrong here except your config (seems like you've set 'olddir /var/log/archive' in /etc/logrotate.conf)
Comment by x33a (x33a) - Monday, 26 March 2012, 02:51 GMT
Yes i have set the olddir to /var/log/archive, but even /var/log/old has the same permissions, so i don't think that it would make a difference. Only the su line seems to be a creating the problem.

from the logrotate.conf manpage:

su user group
Rotate log files set under this user and group instead of using default user/group (usually root). user specifies the user name used for rotation and group specifies the group used for rotation.

Is the exim logrotate file added by the upstream author? Otherwise the packager might know why it includes the su line.
Comment by Dave Reisner (falconindy) - Monday, 26 March 2012, 02:57 GMT
No, the logrotate config is an Arch addition. Looking through the logs, I find this commit:

http://projects.archlinux.org/svntogit/community.git/commit/trunk?h=packages/exim&id=e0be6c22b5a

...which points to  FS#25094 . The su addition is clearly intentional.
Comment by x33a (x33a) - Monday, 26 March 2012, 03:14 GMT
Ok, so i have added exim to the log group and changed the permissions and group of the /var/log/archive folder.

Ran logrotate manually and it rotates the log files fine.

I guess the bug can be closed. Thanks for the help.

Loading...