** Description changed:

  [ Impact ]
  
- On Noble, systemd 255 treats a stopped service that keeps its stored
- file descriptors (FileDescriptorStorePreserve=yes) as still active
- (SubState=dead-resources-pinned). The socket unit then refuses to start
- with "Socket service ... already active, refusing", and does not return
- to listening, so the service cannot be re-activated through its socket.
+ On Noble, systemd 255 mishandles the inactive dead-resources-pinned
+ state of a stopped service that keeps its file descriptors
+ (FileDescriptorStorePreserve=yes). The socket can refuse to reopen or
+ fail to return to listening, leaving clients unable to start the
+ service.
  
- In the authd migration tests, upgrading from the stable PPA left
- authd.socket and authd.service stopped:
- https://github.com/canonical/authd/issues/2317
+ In the authd migration tests, upgrading from the stable PPA to a CI
+ build left authd.socket and authd.service stopped. Managed users could
+ no longer log in: https://github.com/canonical/authd/issues/2317
  
  The authd packaging patch (https://github.com/canonical/authd/pull/2318)
  keeps the socket open during upgrades on Noble. Manual socket restarts
  can still fail.
  
  [ Test Plan ]
  
- A user hits this through socket activation: on Noble, authd opts into
- FileDescriptorStorePreserve=yes, and an upgrade or restart can leave
- authd.socket and authd.service stopped. The attached verify-socket-
- fdstore.sh reproduces that systemd behavior with a minimal socket and
- service pair, so no authd setup is needed to verify it. All steps as
- root on a disposable Noble VM or container.
+ Run this on a Noble system. The attached verify-socket-fdstore.sh
+ reproduces the bug using a temporary socket and service.
  
- 1. Confirm the bug on the stock package:
+ 1. Before installing the proposed update, run:
  
-        bash verify-socket-fdstore.sh
+    sudo bash verify-socket-fdstore.sh
  
-    Both activation paths fail and the script exits 1. The journal shows
- "Socket service ... already active, refusing":
+    Expect exit 1 and these results:
  
-        FAIL: reactivate
-        FAIL: reopen
+    FAIL: reactivate: socket is not listening
+    FAIL: reopen: socket could not reopen
+    PASS: guard
  
- 2. Install the update and reboot so the new PID 1 runs:
+    The reopen journal shows "Socket service ... already active,
+ refusing". Exit 2 means the test setup failed.
  
-        sudo apt install -t noble-proposed systemd
-        reboot
+ 2. Install systemd from noble-proposed and reboot.
  
- 3. Run the script again. All checks pass and the script exits 0:
+ 3. After reboot, confirm the candidate with apt policy systemd. Rerun
+ sudo bash verify-socket-fdstore.sh. Expect exit 0 and:
  
-        PASS: reactivate
-        PASS: reopen
-        PASS: socket start refused while the service is running
+    PASS: reactivate
+    PASS: reopen
+    PASS: guard
  
- 4. The system boots normally and `systemctl is-system-running` reports
- no new failures.
+ 4. Confirm systemctl --failed lists no failed units. Report the tested
+ package version and results on this bug.
  
  [ Where problems could occur ]
  
- The patch lets a socket start or return to listening while its service
- is dead-resources-pinned. An Accept=no socket reopened while its service
- actually runs would leave new clients hanging, because the service keeps
- the old listening socket. A re-activated service could also receive the
- wrong descriptor. The script covers both: the first two checks assert
- the descriptor comes back, the third asserts the refusal. No unit
- shipped in Noble sets FileDescriptorStorePreserve=yes.
+ If systemd lets an Accept=no socket reopen while its service is still
+ running, clients could connect but get no reply: the service is still
+ listening on the old socket. A restarted service could also lose access
+ to resources it had kept open. The script checks both cases.
  
  [ Other Info ]
  
  The fix shipped in systemd v257 and is already in Resolute, Stonking, and 
Tenacious.
  Upstream: https://github.com/systemd/systemd/pull/33874
  
- Verified on Noble: the stock package fails both activation paths, and a
- PID 1 rebuilt with this patch passes every check. The script also passes
- on Resolute, which already has the fix.
+ Noble's default journald unit does not set
+ FileDescriptorStorePreserve=yes, so the verifier uses temporary units
+ instead.
+ 
+ The script fails as expected on Noble and passes on Resolute.

** Attachment removed: "verify-socket-fdstore.sh"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2176110/+attachment/6021018/+files/verify-socket-fdstore.sh

** Attachment added: "verify-socket-fdstore.sh"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2176110/+attachment/6021029/+files/verify-socket-fdstore.sh

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2176110

Title:
  Noble: socket activation fails with a preserved fd store

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2176110/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to