[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is there a generic canonical way for a package script to check network connectivity?



Hi,

On 09.10.23 11:49, Jonathan Kamens wrote:

I need to be able to tell from one of my package scripts whether the host has networking connectivity.

無. There is no such thing as "networking connectivity."

There is "has access to a particular service, at this precise moment in time" and "is usually connected to an unmetered Internet connection so there is a reasonable expectation that a particular service can be reached and should be made part of a workflow."

The latter, for example, is how reportbug deals with this: during configuration, it asks whether the host is typically connected to the Internet, and if you respond yes, it will query Debian services automatically when creating a bug report, and if you respond no, it will ask every time.

In general, I'd rather see an interactive process than background network access by default. When I got a shiny new LTE modem in my laptop, Windows Update burned through my monthly quota within three seconds, and I have very little desire to see Debian repeat _all_ the mistakes of Windows.

Background activity is fine if explicitly configured by the user, which can be a configuration setting (reachable/preseedable through debconf) or even take the form of separate packages.

That this is done so seldom is that there have been no really good use cases for it -- basically the only one we have in Debian is unattended upgrades, and that one is a separate package that additionally provides a policy interface.

Everything else either has an interactivity requirement anyway (reportbug needs to know the name of the package first) or does not benefit substantially (either it's fast, then we don't gain much, or it's slow, then it's usually metered and we don't want speculative downloads).

Last but not least: if this is related to apt-listchanges, then maybe think about the offline case first (upgrades distributed via CD-ROM or USB stick), because pretty much everything that works there can also be implemented through the mirror network and use the existing load balancing and site policy infrastructure. Adding an extra index to the archive is cheaper than running an API endpoint for millions of clients.

   Simon

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


Reply to: