Create the usbmux user in the preinst script

Bug #2034539 reported by Danilo Egea Gondolfo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usbmuxd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The installation of this package as part of the upgrade process from Lunar to Mantic (it's already present in Desktop images so it's not a problem there apparently) is triggering an issue in Netplan https://bugs.launchpad.net/netplan/+bug/1999178

This package will install a udev .rules file referring to a user that will be created only in the final steps of the upgrade process. As systemd daemon-reload is called a number of times during the process. The issue is triggered many times and makes the upgrade take way longer than it should.

In resume, Netplan is calling udevadm reload from a systemd generator, it will process .rules files. When it tries to check the users defined in these files, if they don't exist in /etc/passwd, it will go to systemd (thanks to our nsswitch.conf). But because we are in the middle of a daemon-reload, the userdb is not ready yet and the process will stuck until it times out (for like 2 minutes).

The workaround would be to create the user sooner. But the problem will continue to happen if another package does the same thing.

While this is an issue with Netplan, the proper fix is complicated and we are working on it https://github.com/canonical/netplan/pull/304

How to reproduce the issue: launch a LXD Lunar default or cloud image and try to do a do-release-upgrade to mantic. You'll notice that at some point during the "setting up" phase the process will stuck every time a install script calls a systemctl daemon-reload.

Related branches

description: updated
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Running a "do-release-upgrade -d --allow-third-party" with this PPA (set to Mantic) [1] works around the issue when upgrading a clean Lunar to Mantic.

[1] - https://launchpad.net/~danilogondolfo/+archive/ubuntu/usbmuxd

description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usbmuxd - 1.1.1-3ubuntu1

---------------
usbmuxd (1.1.1-3ubuntu1) mantic; urgency=medium

  * Rename usbmuxd.postinst to usbmuxd.preinst (LP: #2034539)
    - Due to an issue with Netplan (LP#1999178), upgrades from Lunar to Mantic
      are suffering from long pauses. One of the observed causes is the fact
      that usbmuxd will install a udev rules file referring to a user that
      will only be created later in the upgrade process. While we work on the
      proper fix, turning the postinst script that created the user to a
      preinst will help working around this issue.

 -- Danilo Egea Gondolfo <email address hidden> Wed, 06 Sep 2023 12:22:35 +0100

Changed in usbmuxd (Ubuntu):
status: New → Fix Released
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.