[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#445203: debian-policy: 10.8. Log files: /etc/logrotate.d/<package> preferred



On Sun, Jul 04, 2010 at 02:51:27PM -0700, Russ Allbery wrote:
> Steve Langasek <vorlon@debian.org> writes:

> > I'm not nearly so certain that it's not a bug to use invoke-rc.d here.
> > The desired semantics of a logrotate script are "after rotating the log,
> > *iff the daemon is running*, reload it to trigger it to reopen the
> > logfile; otherwise do nothing".  *Neither* the existing example, nor
> > invoke-rc.d, gives these semantics; and switching to invoke-rc.d only
> > makes the wrongness of logrotate's behavior less difficult to
                                                ^^^^ heh, "more"
> > understand.

> What if I change the logrotate example to:

>     invoke-rc.d foo reload > /dev/null

> That appears to be the common practice right now, and that should avoid
> that problem.

I think "invoke-rc.d" is wrong per se for this.  Where the behavior of
'invoke-rc.d foo reload' differs from that of '/etc/init.d/reload', it's
*incorrect* in the context of log rotation: the post-rotation reopening of
logfiles should complete regardless of the runlevel policy for the service.

Cf. my follow-up to bug #588085.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org

Attachment: signature.asc
Description: Digital signature


Reply to: