debconf socket closes if aptdaemon/PK client exits

Bug #1726068 reported by sinu on 2017-10-22
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apper (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
aptdaemon (Ubuntu)
High
Julian Andres Klode
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
packagekit (Ubuntu)
Medium
Julian Andres Klode
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
software-properties (Ubuntu)
High
Unassigned

Bug Description

[Impact]
Closing an application using PackageKit or aptdaemon to install packages kills the debconf endpoint (because it's a subprocess that's cleaned up), causing debconf to use defaults which might lead to wrong results, or even cause installations to fail.

[Solution]
The solution is to move the end point into a socket-activated systemd unit, so that it is independent of the graphical frontend that started the transaction. The other advantage is that this offers us restart if the end point crashes.

[Test case]
1. Install opera deb using packagekit, ensure service is activated
2. Install opera deb using aptdaemon, ensure service is activated

Alternatively, you might use another deb that has debconf prompts.

[Regression potential]
Systems that do not yet use systemd will fall back to the old method, so should not regress.

Otherwise, if there are bugs, they'd affect the ability to show debconf prompts, and behavior would revert to using the defaults.

There might be some uncertainty if you restart your desktop while the helper is running and it does not pick up the new X/Wayland display until it restarts (it should fail to connect and restart). Given that the helper times out, this should not be an issue in practice, as you'd have to logout, login, and start a new install within 60 seconds.

sinu (crsububtu) wrote :
tags: removed: need-duplicate-check
Steve Langasek (vorlon) wrote :

This happens if software-properties is closed on the desktop before the packages have finished installing.

You will need to run 'sudo apt-get -f install' from a terminal to complete the configuration of these packages.

affects: shim-signed (Ubuntu) → software-properties (Ubuntu)
Changed in software-properties (Ubuntu):
importance: Undecided → High
status: New → Triaged
tags: added: id-59558f621454c20af30afa36
Steve Langasek (vorlon) on 2018-02-07
summary: - package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed
- to install/upgrade: subprocess installed post-installation script
- returned error exit status 1
+ software-properties closed, closing debconf socket, while aptdaemon is
+ running (package shim-signed
+ 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade:
+ subprocess installed post-installation script returned error exit status
+ 1)
tags: added: id-5a4d4950c53c0080d7779997

I think dangling sockets to the frontend might also be a problem with PackageKit, but I'm not sure. My idea was to have helper have a timeout and be (re)launched by systemd via socket activation, but
I don't know if that's feasible.

Changed in software-properties (Ubuntu):
status: Triaged → Invalid
Changed in aptdaemon (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in packagekit (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
summary: - software-properties closed, closing debconf socket, while aptdaemon is
- running (package shim-signed
- 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1)
+ debconf socket closes if aptdaemon/PK client exists
summary: - debconf socket closes if aptdaemon/PK client exists
+ debconf socket closes if aptdaemon/PK client exits
no longer affects: plasma-discover (Ubuntu)
Changed in packagekit (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Changed in aptdaemon (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package packagekit - 1.1.12-5ubuntu3

---------------
packagekit (1.1.12-5ubuntu3) eoan; urgency=medium

  * Actually enable the socket-activated client helper

packagekit (1.1.12-5ubuntu2) eoan; urgency=medium

  * Actually install the socket-activated client helper
  * Do not use pk_client_helper_get_instance_private(), this does not
    actually work, probably needs different type setup.

packagekit (1.1.12-5ubuntu1) eoan; urgency=medium

  * Use a socket-activated client helper (LP: #1726068)

 -- Julian Andres Klode <email address hidden> Fri, 24 May 2019 12:08:09 +0200

Changed in packagekit (Ubuntu):
status: In Progress → Fix Released
Changed in aptdaemon (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptdaemon - 1.1.1+bzr982-0ubuntu22

---------------
aptdaemon (1.1.1+bzr982-0ubuntu22) eoan; urgency=medium

  * Use PackageKit's socket-activated debconf helper (LP: #1726068)
  * Fix failing tests and disable ones we do not care about anymore (PK/PEP8)
  * Make failing tests fail the build again
  * Drop python2 support

 -- Julian Andres Klode <email address hidden> Fri, 24 May 2019 12:16:27 +0200

Changed in aptdaemon (Ubuntu):
status: Fix Committed → Fix Released
no longer affects: software-properties (Ubuntu Bionic)
no longer affects: software-properties (Ubuntu Disco)
Changed in packagekit (Ubuntu Disco):
status: New → In Progress
description: updated
Steve Langasek (vorlon) wrote :

I don't think this test case is well formed, it doesn't describe how to install the packages with the named backends and it doesn't mention needing to kill the frontend or when to kill it.

Changed in packagekit (Ubuntu Disco):
status: In Progress → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers