microsoft/WSL

systemd running with 100% and does not respond

steven-r opened this issue · 4 comments

Version

Microsoft Windows [Version 10.0.22000.1042]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.62.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

systemd/jammy-updates,now 249.11-0ubuntu3.6 amd64

Repro Steps

  • enable systemd
  • set log_target to kmsg
  • run dmesg

Expected Behavior

Systemd is running and system behaves normal

Actual Behavior

systemd is running but floods kmsg and cpu is at 100% (even w/o log_target). No systemctl command passes through.

steven:~$ LANG=C systemctl status
Failed to read server status: Transport endpoint is not connected

Diagnostic Logs

dmesg output

[ 1273.089268] systemd[1]: acpid.service: Trying to enqueue job acpid.service/start/replace
[ 1273.089282] systemd[1]: tmp.mount: Cannot add dependency job, ignoring: Unit tmp.mount not found.
[ 1273.089344] systemd[1]: ovsdb-server.service: Cannot add dependency job, ignoring: Unit ovsdb-server.service not found.
[ 1273.089380] systemd[1]: acpid.service: Installed new job acpid.service/start as 552357512
[ 1273.089381] systemd[1]: acpid.service: Enqueued job acpid.service/start as 552357512
[ 1273.089385] systemd[1]: acpid.service: ConditionVirtualization=!container failed.
[ 1273.089386] systemd[1]: acpid.service: Starting requested but condition failed. Not starting unit.
[ 1273.089387] systemd[1]: acpid.service: Job 552357512 acpid.service/start finished, result=done
[ 1273.089388] systemd[1]: Condition check resulted in ACPI event daemon being skipped.
[ 1273.089389] systemd[1]: acpid.path: Got notified about unit deactivation.
[ 1273.089395] systemd[1]: acpid.path: Got triggered.
[ 1273.089396] systemd[1]: acpid.service: Trying to enqueue job acpid.service/start/replace
[ 1273.089409] systemd[1]: tmp.mount: Cannot add dependency job, ignoring: Unit tmp.mount not found.
[ 1273.089471] systemd[1]: ovsdb-server.service: Cannot add dependency job, ignoring: Unit ovsdb-server.service not found.
[ 1273.089505] systemd[1]: acpid.service: Installed new job acpid.service/start as 552357593
[ 1273.089506] systemd[1]: acpid.service: Enqueued job acpid.service/start as 552357593
[ 1273.089510] systemd[1]: acpid.service: ConditionVirtualization=!container failed.
[ 1273.089511] systemd[1]: acpid.service: Starting requested but condition failed. Not starting unit.
[ 1273.089512] systemd[1]: acpid.service: Job 552357593 acpid.service/start finished, result=done
[ 1273.089513] systemd[1]: Condition check resulted in ACPI event daemon being skipped.
[ 1273.089514] systemd[1]: acpid.path: Got notified about unit deactivation.
[ 1273.089520] systemd[1]: acpid.path: Got triggered.
[ 1273.089521] systemd[1]: acpid.service: Trying to enqueue job acpid.service/start/replace
[ 1273.089534] systemd[1]: tmp.mount: Cannot add dependency job, ignoring: Unit tmp.mount not found.

Looks like acpid is stuck in a runaway activation loop. But since acpid isn't going to be doing anything useful under WSL anyway (being for hardware support), I suggest you manually mask the relevant units with:

sudo ln -s /dev/null /etc/systemd/system/acpid.service
sudo ln -s /dev/null /etc/systemd/system/acpid.path

then shut down and restart your WSL instance.

Hi, systemd is starting now, thanks for the quick fix, but still doesn't respond:

[   48.293227] systemd[163]: Not remounting /run/systemd/unit-root/sys/fs/cgroup/pids deny-listed by /run/systemd/unit-root/sys/fs/cgroup, called for /run/systemd/unit-root/sys
[   48.293232] systemd[163]: Not remounting /run/systemd/unit-root/sys/fs/cgroup/rdma deny-listed by /run/systemd/unit-root/sys/fs/cgroup, called for /run/systemd/unit-root/sys
[   49.155384] hv_balloon: Max. dynamic memory size: 8044 MB
[   93.311250] Failed to query system state: Transport endpoint is not connected
[   93.312174] WSL (2) ERROR: InitCreateSessionLeader:1072: systemd: failed to start within 10000

and

 systemctl status
Failed to read server status: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)

Hi, systemd is starting now, thanks for the quick fix, but still doesn't respond:

[   48.293227] systemd[163]: Not remounting /run/systemd/unit-root/sys/fs/cgroup/pids deny-listed by /run/systemd/unit-root/sys/fs/cgroup, called for /run/systemd/unit-root/sys
[   48.293232] systemd[163]: Not remounting /run/systemd/unit-root/sys/fs/cgroup/rdma deny-listed by /run/systemd/unit-root/sys/fs/cgroup, called for /run/systemd/unit-root/sys
[   49.155384] hv_balloon: Max. dynamic memory size: 8044 MB
[   93.311250] Failed to query system state: Transport endpoint is not connected
[   93.312174] WSL (2) ERROR: InitCreateSessionLeader:1072: systemd: failed to start within 10000

and

 systemctl status
Failed to read server status: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)

Same issue here solved with the same solution

> wsl --version
WSL version: 1.2.0.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19044.2604

I had to disable other hw related services as well (gpu)

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!