On Sun, 2 May 2021 14:11:59 -0700 Ross Boylan wrote:

[...]
> On Sun, May 2, 2021 at 11:08 AM Francesco Poli
> <invernom...@paranoici.org> wrote:
[...]
> > I wonder why logcheck does not send hourly mail messages about
> > anacron...
> >
> 
> For logcheck to send a message there must be something in the logs it
> checks and it must either match a pattern logcheck thinks is
> noteworthy or (from memory) fail to match a pattern for things that
> are OK.  I haven't reviewed exactly why the messages are being noted,
> albeit at logcheck's lowest severity level.  I configured logcheck  to
> use workstation mode.

In my humble opinion, this is the point that needs to be better
scrutinized.
Anacron systemd timer fires hourly, but logcheck does not consider it
as something worth a mail message.
On the other hand, it annoys users with messages about apt-listbugs
systemd timer triggers, which are equally "normal".

I would be grateful, if you could find out why.
I am asking you, since you seem to be more knowledgeable about logcheck
than me.

[...]
> Let's see how apt-daily-upgrade works:
[...]
> ExecStartPre=-/usr/lib/apt/apt-helper wait-online
[...]
>
> 3. network targets in [Unit] to (try to?) assure connectivity.  BTW,
> for some insight into why the network target doesn't work as expected,
> see https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/.
> I still find it annoying, but I appreciate the point that it is not
> straightforward to say exactly what the network being "up" means.

This is one of the trickiest parts.
There seems to be no reliable method to check whether a box is "online".

Please note that apt-daily-upgrade uses "/usr/lib/apt/apt-helper
wait-online", which is shipped by package 'apt', see its [source].

[source]: 
<https://salsa.debian.org/apt-team/apt/-/blob/main/cmdline/apt-helper.cc>

I could not find any man page for that helper command.

It seems to me that that helper fails to detect whether an Ethernet
interface (managed with ifup/ifdown) is configured.

  # ifdown enp0s25 

Internet is not reachable... but, nonetheless the command immediately
exits reporting a zero exit status:

  $ /usr/lib/apt/apt-helper wait-online
  $ echo $?
  0

After bringing the interface back up:

  # ifup enp0s25 

Internet is again reachable... but... no difference:

  $ /usr/lib/apt/apt-helper wait-online
  $ echo $?
  0

If it cannot see that a network interface of the box it is running on
is down... what about issues farther away from the local host?

I don't think this approach could work for apt-listbugs...

[...]
> > The timer would only trigger once every (slightly less than one) day:
> > if your system is not online during that only attempt, you are out of
> > luck for another day or so...
> 
> I think OnActiveSec triggers an initial run 5minutes after system startup.
> Have I misunderstood the semantics?

That's correct, I think.
But then, after the boot, you only have one attempt a day, more or less.

So, unless you reboot at least once a day (and be online shortly
after!), you may fail several attempts in a row, just because you are
not online at the "right" time...

[...]
> > I am open to suggestions on how to change the Description field for the
> > timer.
> > I see that the Description for the anacron timer is "Trigger anacron
> > every hour": maybe I should think about a Description that uses the
> > word "hourly", rather than "daily".
> 
> If sticking with the current setup but changing the message, it currently is
>      Starting Daily apt-listbugs preferences cleanup...
> (or Finishing ....).
> Maybe
>      Starting check for daily apt-listbugs preferences cleanup...
> and/or different messages depending on what happened:
>      Skipping daily apt-listbugs preferences cleanup. Too soon.
> or
>      Finished run of daily apt-listbugs preferences cleanup.

I don't think I can customize the message generated by systemd: it's
apparently "Starting <Description>..." and "Finished <Description>.".
I can only change the Description field, as far as I can tell.

But your suggestion is not too bad.
Maybe something like:

  Description=Hourly check for daily apt-listbugs preferences cleanup

A bit clumsy, perhaps.
I have to think about it.

> 
> BTW, I don't know what the job is doing,

Please take a look at the apt-listbugs(1) man page:

[...]
|      Each package pin is automatically removed by a daily cron job (or by an
|      equivalent systemd timer), as soon as the corresponding bug is fixed in
|      (or no longer affects) the package version available  for  installation
|      or upgrade. When the pin is removed, the installation or upgrade of the
|      package becomes possible again.
[...]

> but should it also do it after
> someone dpkg-reconfigure's apt-listbugs?

Does "dpkg-reconfigure apt-listbugs" do anything?
Maybe I am just tired right now, but I think it does nothing...


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpMRUu3jWN0u.pgp
Description: PGP signature

Reply via email to