Bug#932328: logrotate.timer "breaks" activity report of /etc/cron.daily/exim4-base

Sven Hartge sven at svenhartge.de
Sun Jul 28 18:11:58 BST 2019


On 28.07.19 18:53, Andreas Metzler wrote:

> I /think/ setting Before= in *both* .service and .timer is strange.

I think you just need it in the Service. But I am not sure. The
documentation was a bit sparse on that matter. Other times, just as the
apt ones you mentioned have it in both places.

Please ask the systemd guys for clarification on that matter.

But in the end it shouldn't hurt to have it in both the timer and the
service.

> Is this supposed to work like this?
> 1. When systemd looks at the timers it finds that both logratoe and exim
> have identical time specifications. With the Before= setting it
> triggers logrotate.service after exim.service. Otherwise it might work
> out the other way round, or they are started in parallel.
> 2. When running exim.service systemd again finds a Before= and waits
> with starting log-rotation until after exim's job has finished?

Exactly. At least that is how it works in my systems.

My main system is fast enough so that both exim4-base.service and
logrotate.service get started in the same second, but I see from the
logreport from exim4-base that it uses the whole logfile from the last
day, whereas before my changes I got a report spanning from 00:00 to 00:26.

On another system, which is very slow and has a very very slow storage,
I can see logrotate.service being clearly startet after
exim4-base.service finishes.

Looks like this in the logs:

Jul 28 00:00:22 svenhartge systemd[1]: Starting Daily man-db regeneration...
Jul 28 00:00:22 svenhartge systemd[1]: Starting exim4-base housekeeping...
Jul 28 00:00:38 svenhartge systemd[1]: Started exim4-base housekeeping.
Jul 28 00:00:38 svenhartge systemd[1]: Starting Rotate log files...
Jul 28 00:00:44 svenhartge systemd[1]: man-db.service: Succeeded.
Jul 28 00:00:44 svenhartge systemd[1]: Started Daily man-db regeneration.

logrotate.service waits until exim4-base.service is done, which is
exactly the way you want this to be.

Grüße,
Sven.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-exim4-maintainers/attachments/20190728/38fabfb4/attachment.sig>


More information about the Pkg-exim4-maintainers mailing list