Bug#1094457: rtkit: Please stop and restart rtkit during sleep
Package: rtkit
Version: 0.13-5.1
Severity: important
Tags: patch upstream
rtkit doesn't handle suspend/resume correctly - it thinks the canary thread
starves the whole time it's suspended, then demotes threads on resume.
See bug from 2019: https://github.com/heftig/rtkit/issues/13
The proper fix is likely to accept this patch from 2023:
https://github.com/heftig/rtkit/pull/35
rtkit seems to be unmaintained: https://github.com/heftig/rtkit/issues
Can we add a downstream workaround for this problem? The systemd service
below stops rtkit before sleep, then awakens it again on resume:
```
[Unit]
Description=Disable rtkit during sleep
Before=sleep.target
PartOf=sleep.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=sh -c 'if systemctl is-active --quiet rtkit-daemon.service; then
touch /tmp/rtkit-sleep.service ; systemctl stop rtkit-daemon.service; else rm
-f /tmp/rtkit-sleep.service; fi'
ExecStop=sh -c 'if [ -e /tmp/rtkit-sleep.service ]; then rm -f /tmp/rtkit-
sleep.service ; systemctl start --no-block rtkit-daemon.service; fi'
PrivateTmp=disconnected
[Install]
WantedBy=sleep.target
```
I put this proof-of-concept in /lib/systemd/system/rtkit-sleep.service,
then enabled it and it worked for me. I guess you'll want to make it
prettier before including it though?
-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.10-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages rtkit depends on:
ii adduser 3.137
ii dbus [default-dbus-system-bus] 1.16.0-1
ii libc6 2.40-6
ii libcap2 1:2.66-5+b1
ii libdbus-1-3 1.16.0-1
ii libsystemd0 257.2-3
ii policykit-1 124-2
ii polkitd 126-2
rtkit recommends no packages.
rtkit suggests no packages.
-- no debconf information
Reply to: