On Mon, 25 Jun 2012 23:56:10 -0700
Bryan Gardiner <bog@khumba.net> wrote:
> On Mon, 25 Jun 2012 18:20:22 -0400
> Michael Mol <mikemol@gmail.com> wrote:
>
> > On Mon, Jun 25, 2012 at 2:19 PM, Jarry <mr.jarry@gmail.com> wrote:
> > > I always run emerge as root. But back to my question: on all
> > > boxes with "A" access rights I can not rotage portage logs.
> > > All I get is mail from my cron saying: "error setting owner
> > > of /var/log/portage/elog/summary.log-20110803.gz: Operation
> > > not permitted..."
> > >
> > > On the other side, on boxes with "B" access rights (see above)
> > > logs are rotated without problem. Logrotate-script is the same:
> > >
> > > /var/log/portage/elog/summary.log {
> > > * *su portage portage
> > > * *missingok
> > > * *nocreate
> > > * *delaycompress }
> > >
> > > So I suppose either there is something wrong with "A", or
> > > logrotate script must be modified (although it works for "B")...
> >
> > For reference:
> >
> > On my laptop:
> > ls -l /var/log/portage
> > total 4
> > drwxrwsr-x 2 portage portage 4096 Dec 29 18:45 elog
> >
> >
> > On a very-fresh-install of Gentoo:
> >
> > ls -l /mnt/gentoo/var/log/portage/
> > total 4
> > drwxrwsr-x 2 portage portage 4096 Jun 25 14:16 elog
> >
> >
> > It seems to me that the proper permissions for /var/log/portage/elog
> > are likely:
> > * chmod 0775
> > * chown portage.portage
>
> Agreed that these are the correct permissions (setgid seems sensible
> too). Bug #374287 talks about this ownership a bit. Also, when
> /usr/lib/portage/pym/portage/elog/mod_save.py is invoked, it copies
> the gid down to /var/log/portage/elog from /var/log/portage, so
> mystery mostly solved... But what accounts for the difference in
> ownership of /var/log/portage?

>
> - Bryan
>
Ahem, _initial_ ownership of /var/log/portage. So at least, it's
possible to chgrp /var/log/portage and have the ownership stick.
- Bryan