Subject: /etc/logrotate.d/lighttpd: Questionable use of invoke-rc.d

From: Opty <[email-masked]>
Date: Tue, 1 Apr 2025 14:41:25 +0200

Package: lighttpd
Version: 1.4.69-1

/etc/logrotate.d/lighttpd uses invoke-rc.d to notify lighttpd to
reopen logs but it doesn't work when using
policy-rcd-declarative-deny-all so shouldn't the logrotate
configuration snippet use rather 'service' ?

Regards,
Opty

---

From: Mark Hindley <[email-masked]>
Date: Tue, 1 Apr 2025 17:36:48 +0100

Control: tags -1 debian

Opty,

> configuration snippet use rather 'service' ?

Possibly, but I am not sure. Certainly all the other /etc/logrotate.d examples I
can find use invoke-rc.d. It may be to prevent rotation in chroots and the like
when it would fail.

However, I am sure that lighttpd isn't forked in Devuan and so this should be
reported directly to Debian's BTS.

Thanks

Mark

---

From: Opty <[email-masked]>
Date: Wed, 2 Apr 2025 13:56:10 +0200

> reported directly to Debian's BTS.

Now that Debian uses systemd by default I considered Devuan a better
place for System V style init stuff but I will think about reporting
to Debian BTS then.

Regards,
Opty

---

From: Lorenzo <[email-masked]>
Date: Wed, 2 Apr 2025 14:12:08 +0200

On Wed, 2 Apr 2025 13:56:10 +0200
Opty <[email-masked]> wrote:

> > However, I am sure that lighttpd isn't forked in Devuan and so this
> > should be reported directly to Debian's BTS.
> 

Please don't: while this may solve your use case it will break other
more common use cases that are currently working.
Example:
lighttpd installed but disabled by the local admin (K links) but if
service wrapper is used instead of invoke-rc.d the logrotate snippet
will try to signal lighttpd regardless, which should not happen.

on a side note, runit is currently using invoke-rc.d to forward
logrotate actions to runit services, so your change would break that too

Regards,
Lorenzo

> 
> Regards,
> Opty
> _______________________________________________
> devuan-dev internal mailing list
> [email-masked]
> Manage your subscription:
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/devuan-dev
> Archive: https://lists.dyne.org/lurker/list/devuan-dev.en.html

---

From: Opty <[email-masked]>
Date: Wed, 2 Apr 2025 14:42:19 +0200

> will try to signal lighttpd regardless, which should not happen.

Good, no work for me. :-)

I should have written that I was actually afraid of something like
that in general but 'service' seemed as the best proposal at that
time. See also #881.

Regards,
Opty

---

From: Opty <[email-masked]>
Date: Wed, 2 Apr 2025 15:20:39 +0200

> that in general but 'service' seemed as the best proposal at that

I recalled why I proposed 'service' and even reported all of these:

"invoke-rc.d and policy-rc.d are precisely interfaces expected to be
used only by maintainer scripts. Anything else done during run-time
should be using some other interface, such as service(8) for example
or an init specific one, otherwise that should be considered a bug."

and

"In case this is a local problem where you have deployed
non-maintainer scripts using invoke-rc.d, then while you fix those,
you could check in policy-rc.d if you are running inside dpkg by
checking if the environment variable DPKG_RUNNING_VERSION is defined
(documented in dpkg(1))."

(see https://bugs.debian.org/804018#25)

Regards,
Opty