voxpupuli / puppet-logrotate

Puppet logrotate module
https://forge.puppet.com/puppet/logrotate
MIT License
26 stars 92 forks source link

Support hourly logrotate directory on EL9 again. #221

Closed traylenator closed 8 months ago

traylenator commented 8 months ago

Pull Request (PR) description

When EL9 switched to using systemd (quite correctly ) in #216 support for a special directory for hourly logrotations was removed - that change was backwards incompatible.

Add that functionality back with a new unit and timer

While this could be achieved by reducing the period of existing timer to hourly I presume the motivation for this was to avoid processing all logrotate directives every hour which does make some sense.

Following this patch:

# systemctl list-timers | grep logro
Mon 2024-02-19 14:00:00 CET 46min left  -                           -            logrotate-hourly.timer       logrotate-hourly.service
Tue 2024-02-20 00:00:00 CET 10h left    Mon 2024-02-19 09:53:53 CET 3h 19min ago logrotate.timer              logrotate.service

and

# systemctl show logrotate-hourly.service -p ExecStart
ExecStart={ path=/usr/sbin/logrotate ; argv[]=/usr/sbin/logrotate /etc/logrotate.d/hourly ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
traylenator commented 8 months ago

CentOS 8 tests are a timeout.