Monday, October 31, 2011

error: error setting owner of /var/log/portage/elog/summary.log-.gz: Operation not permitted

Sometimes on my gentoo servers I get sut errors via cron:

error: error setting owner of /var/log/portage/elog/summary.log-20110809.gz: Operation not permitted


as you can see



# cat /etc/logrotate.d/elog-save-summary 

# Copyright 1999-2011 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# Rotate the log created by the save_summary elog module.




/var/log/portage/elog/summary.log {
    su portage portage
    missingok
    nocreate
    delaycompress
}

and

# ll /var/log/portage/elog/summary.log-20110809
-rw-rw-r-- 1 root portage 1280 Aug  8 09:29 /var/log/portage/elog/summary.log-20110809

owner of file is root and logrotate use portage user, so it can can't rotate this file
the solution of this problem is: change files owner:

chown  portage /var/log/portage/elog/summary.log-20110809

No comments: