On Tue, 4 Jul 2023, Harald Dunkel wrote:

Hi folks,

what is the recommended way to override logrotate.timer from a
metapackage to get hourly logfile rotation (depending on size
and age of the logfile, as usual)?

I had added

        etc/systemd/system/logrotate.timer.d/hourly.conf

I'm not exactly clear what you're doing but I guess you're creating a
package that provides the config file?

Sticking config files in packages can be problematic when it comes to
upgrades. I do it a lot, in particular it makes it much easier to change
the config across lots of machines, but doing it all "properly" in the
face of local edits isn't easy.

Others would probably say use ansible (or something like that) but
it works for me.


to the package install file, but at upgrade time it complained
that nobody ran systemctl daemon-reload. Ain't this the job of
the DEBHELPER macro in the postinst script?

Once your package is installed, what does the postinst script look like?


Should this file be installed in /lib/systemd/system/logrotate.timer.d
instead, using dh_installsystemd ?


Assuming you are creating a package and you want to share it with
possible local edits in /etc then this would be the way to go. If, like
me, you're using a package in place of manually editing then /etc is
more likely the right place.



Every insightful is highly appreciated

Harri



Reply via email to