Add ability for mirrors to distinguish interactive and non-interactive apt runs

Bug #1825000 reported by David Lawson
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned
Eoan
Won't Fix
High
Unassigned

Bug Description

As part of a larger scale plan to manage traffic to the main archive servers it would be useful if apt could provide a facility for us to identify interactive vs. non-interactive traffic on the server side, ideally via a header of some kind.

Revision history for this message
David Lawson (deej) wrote :

Obviously this may be equally relevant to unattended-upgrades.

tags: added: rls-ee-incoming
Changed in apt (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Changed in apt (Ubuntu Eoan):
importance: Wishlist → High
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

/usr/lib/apt/apt.systemd.daily should force set a Useragent apt.systemd.daily, for all operations.

irrespective how/who/what invoked /usr/lib/apt/apt.systemd.daily

Revision history for this message
Julian Andres Klode (juliank) wrote :

So, I think we want to do that for apt-daily.service which does the downloading of package lists and updates; but not for the actual upgrade job - which might fetch any remaining packages.

tags: added: id-5cf9354bf2165a4e38392bbb
Steve Langasek (vorlon)
tags: removed: rls-ee-incoming
Revision history for this message
Julian Andres Klode (juliank) wrote :
Changed in apt (Ubuntu):
status: Triaged → In Progress
Changed in apt (Ubuntu Eoan):
status: Triaged → Won't Fix
status: Won't Fix → Triaged
Revision history for this message
Julian Andres Klode (juliank) wrote :

The attached merge proposal adds the name of the systemd unit that we are running under to the HTTP User-Agent field. Is that sufficient?

Revision history for this message
Junien F (axino) wrote :

Probably ! What is it going to be for interactive uses though ?

Revision history for this message
Julian Andres Klode (juliank) wrote :

Well, nothing, absence of service is interactive?

Revision history for this message
Julian Andres Klode (juliank) wrote :

Note that there were some I think somewhat valid privacy concerns to exposing the service name.

Maybe it's enough to know if apt ran as part of a systemd service, but not which service, or we build a whitelist of services (or check if they are inside /lib/systemd/system - so we do not send local service names). Currently we do have a blacklist that matches user@ services.

Another approach was to send whether a tty is attached, but I believe that's a bit less useful

Revision history for this message
Junien F (axino) wrote :

I think "User-Agent: Debian APT-HTTP/1.3 (2.0.1) non-interactive" would be enough.

Changed in apt (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.0.2

---------------
apt (2.0.2) unstable; urgency=medium

  [ Boyuan Yang ]
  * Simplified Chinese program translation update (Closes: #955023)

  [ Frans Spiesschaert ]
  * Dutch program translation update (Closes: #955505)

  [ Marco Ippolito ]
  * Fix gramma in apt(8): "by append(+ing) a" (Closes: #955412)

  [ Chris Leick ]
  * German manpage translation update
  * Fix "string match{ing,es}" and whitespace typo in apt-patterns(7)

  [ Julian Andres Klode ]
  * test/integration/apt.pem: Regenerate with SHA2 hashes to make the
    test work with stricter gnutls in Ubuntu which rejects SHA1
  * ubuntu: http: Add non-interactive to user agent if run by systemd
    (LP: #1825000)

 -- Julian Andres Klode <email address hidden> Thu, 09 Apr 2020 12:21:07 +0200

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

eoan has reached end of life, so this bug will not be fixed for that release

Changed in apt (Ubuntu Eoan):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.