• Bug#1101175: systemd: mounts a tmpfs on /tmp in the middle of upgrade

    From Tollef Fog Heen@21:1/5 to All on Mon Mar 24 10:30:01 2025
    Package: systemd
    Version: 257.4-3
    Severity: critical
    Justification: breaks apt completely

    I was upgrading my system from bookworm to trixie when it broke in the
    middle with apt complaining about not finding a set of .debs in /tmp.
    It turned out that systemd had activated the tmp.mount unit in the
    middle of the upgrade.

    As this was a large dist-upgrade, I'm not sure exactly what happened,
    but some excerpts from the journal:

    Mar 24 06:54:36 x systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.
    Mar 24 06:54:36 x systemd[1]: Mounting tmp.mount - Temporary Directory /tmp... Mar 24 06:54:36 x systemd[1]: Mounted tmp.mount - Temporary Directory /tmp.
    Mar 24 06:54:36 x systemd[1]: Starting man-db.service - Daily man-db regeneration...
    Mar 24 06:54:40 x systemd[1]: man-db.service: Deactivated successfully.
    Mar 24 06:54:40 x systemd[1]: Finished man-db.service - Daily man-db regeneration.

    man-db.service is a service with PrivateTmp=true, and according to
    advice on #debian-devel, such a service will have Wants/After=tmp.mount.
    The masking of the tmp.mount unit happens in postinst, so there's a race
    where the new package might be unpacked, something calls systemctl daemon-reload and then a service with PrivateTmp gets activated before systemd's postinst is called.

    I'm filing this as critical since it left the system completely broken
    and required extensive use of dpkg -i to recover.

    A better solution is probably to do the masking in preinst instead of
    postinst, assuming my analysis is correct.

    --
    Tollef Fog Heen
    UNIX is user friendly, it's just picky about who its friends are

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Tue Mar 25 01:20:04 2025
    Processing control commands:

    tag -1 pending
    Bug #1101175 [systemd] systemd: mounts a tmpfs on /tmp in the middle of upgrade Added tag(s) pending.

    --
    1101175: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101175
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luca Boccassi@21:1/5 to All on Tue Mar 25 01:20:09 2025
    Control: tag -1 pending

    Hello,

    Bug #1101175 in systemd reported by you has been fixed in the
    Git repository and is awaiting an upload. You can see the commit
    message below and you can check the diff of the fix at:

    https://salsa.debian.org/systemd-team/systemd/-/commit/581a5994f54e430300cc9557fb2e2b270f3f1335

    ------------------------------------------------------------------------
    Handle new tmp mount on upgrade in preinst rather than postinst

    Avoid race with new units being activated and pulling it in
    at the same time

    Closes: #1101175 ------------------------------------------------------------------------

    (this message was generated automatically)
    --
    Greetings

    https://bugs.debian.org/1101175

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Fri Mar 28 05:30:01 2025
    This is a multi-part message in MIME format...

    Your message dated Fri, 28 Mar 2025 04:19:28 +0000
    with message-id <E1ty1Bo-00GKGS-AC@fasolo.debian.org>
    and subject line Bug#1101175: fixed in systemd 257.4-4
    has caused the Debian Bug report #1101175,
    regarding systemd: mounts a tmpfs on /tmp in the middle of upgrade
    to be marked as done.

    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.

    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)


    --
    1101175: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101175
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 24 Mar 2025 09:21:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-18.0 required=4.0 tests=BAYES_00,
    BODY_INCLUDES_PACKAGE,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,
    DKIM_VALID_EF,FOURLA,HAS_PACKAGE,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,
    SPF_PASS,X_DEBBUGS_CC autolearn=ham autolearn_force=no
    version=3.4.6-bugs.debian.org_2005_01_02
    X-Spam-Bayes: score:0.0000 Tokens: new, 11; hammy, 150; neutral, 73; spammy,
    0. spammytokens: hammytokens:0.000-+--trixie, 0.000-+--bookworm,
    0.000-+--systemctl, 0.000-+--distupgrade, 0.000-+--dist-upgrade Return-path: <tfheen@err.no>
    Received: from vuizook.err.no ([2a02:20c8:2640::2]:43322)
    by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256