I reproduced the issue again today on the same Ubuntu 24.04 Hyper-V
guest, this time during a completely normal unattended upgrade and
without rebooting or restarting the VM.

The VM had been running for almost 15 days. It had only been live-
migrated between Hyper-V cluster nodes the previous evening.

At 06:55 unattended-upgrades started and upgraded, among other packages,
libc6 from 2.39-0ubuntu8.8 to 2.39-0ubuntu8.9.

During libc6 configuration, its postinst script explicitly executed:

```
systemctl daemon-reexec
```

The journal shows:

```
Sep 11 06:56:00 systemd[1]: Reexecuting requested from client PID 324406 
('systemctl') (unit apt-daily-upgrade.service)...
Sep 11 06:56:00 systemd[1]: Reexecuting.
Sep 11 06:56:00 systemd[1]: systemd 255.4-1ubuntu8.17 running in system mode
Sep 11 06:56:00 systemd[1]: Detected virtualization microsoft.
Sep 11 06:57:31 systemd[1]: Failed to fork off sandboxing environment for 
executing generators: Protocol error
Sep 11 06:57:31 systemd[1]: Freezing execution.
```

So the failure occurred 91 seconds after the daemon-reexec request.

Immediately afterwards other system components started losing
communication with PID 1:

```
systemd-journald: Failed to send WATCHDOG=1 notification message
systemd-oomd: Failed to connect ... Connection refused
dbus-daemon: Failed to activate service 'org.freedesktop.systemd1': timed out
```

Later, systemd-logind could no longer create session scopes and SSSD-
based logins stopped working.

While the system was still in the failed state:

```
# cat /proc/1/wchan
do_wait
```

/proc/1/stack showed:

```
do_wait
kernel_waitid
__do_sys_waitid
__x64_sys_waitid
```

and /proc/1/syscall showed PID 1 blocked in waitid().

There was no obvious remaining generator/sandbox child process visible
below PID 1. The normal long-running services were still present, which
explains why existing processes continued to run while systemctl, logind
session creation and new user logins failed.

The libc6 postinst responsible for triggering the reexec contains:

```
# Restart systemd on upgrade, but carefully.
...
if systemd --help >/dev/null 2>/dev/null; then
    systemctl daemon-reexec
fi
```

This is therefore not only reproducible with a manually issued
`systemctl daemon-reexec`. A regular unattended libc6 upgrade can
trigger the same systemd failure on this machine.

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

Title:
  systemd freezes after daemon-reexec triggered by unattended-upgrades /
  needrestart on Ubuntu 24.04

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


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

Reply via email to