csd-power does not hold handle-lid-switch inhibitor, so logind suspends on lid close despite "Do nothing" setting
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c, linux
- Domain
- desktop, operating-systems
Research direction
Start with csd-power and reproduce the lid-close behavior using the Power Management settings and systemd-inhibit --list. Trace why the handle-lid-switch inhibitor is absent or lost after resume or monitor changes; done means the configured “Do nothing” action is enforced and the inhibitor remains present in the reported scenario.
Written by the indexing model from the issue text.
Description
Summary
In Power Management, "When the lid is closed" is set to Do nothing for both battery and AC, but the laptop still suspends on most lid closes. csd-power is running and inhibit-lid-switch is true, yet no handle-lid-switch inhibitor is registered with systemd-logind. As a result logind falls back to its own default (HandleLidSwitch=suspend) and suspends the machine. The UI gives no indication that the chosen setting is not in effect.
Environment
- Distro: Ubuntu 24.04.5 LTS, X11 session
- cinnamon 6.0.4-4, cinnamon-settings-daemon 6.0.0-1build4
- systemd 255.4-1ubuntu8.17
- Kernel 7.0.0-31-generic
- Hardware: Dell Latitude 5330
- No custom logind.conf (stock defaults)
Settings
$ gsettings list-recursively org.cinnamon.settings-daemon.plugins.power | grep -i lid
org.cinnamon.settings-daemon.plugins.power inhibit-lid-switch true
org.cinnamon.settings-daemon.plugins.power lid-close-ac-action 'nothing'
org.cinnamon.settings-daemon.plugins.power lid-close-battery-action 'nothing'
org.cinnamon.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
logind effective values:
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=(unset, falls back to HandleLidSwitch)
HandleLidSwitchDocked=ignore
Inhibitors (csd-power running, PID 2959)
$ systemd-inhibit --list
WHO UID USER PID COMM WHAT WHY MODE
ModemManager 0 root 1446 ModemManager sleep ModemManager needs to reset devices delay
NetworkManager 0 root 1334 NetworkManager sleep NetworkManager needs to turn off ... delay
UPower 0 root 1802 upowerd sleep Pause device polling delay
... 0 root 1942 unattended-upgr shutdown ... delay
<user> 1001 <user> 2977 csd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key Cinnamon handling keypresses block
<user> 1001 <user> 2959 csd-power sleep Cinnamon needs to lock the screen delay
slack 1001 <user> ... slack sleep Application cleanup before suspend delay
There is no handle-lid-switch block inhibitor from csd-power, even though inhibit-lid-switch is true.
Logs
logind suspends immediately on lid close. The only lid closes that don't cause a suspend are docked closes (external monitor) or closes within logind's ~30s post-resume holdoff. That is why the behavior looks intermittent.
Sep 29 08:02:45 systemd-logind[1290]: Lid closed.
Sep 29 08:02:45 systemd-logind[1290]: Suspending...
Sep 29 18:15:31 systemd-logind[1290]: Lid closed.
Sep 29 18:15:31 systemd-logind[1290]: Suspending...
Sep 30 08:12:43 systemd-logind[1290]: Lid closed.
Sep 30 08:12:43 systemd-logind[1290]: Suspending...
Sep 30 08:12:53 systemd-logind[1290]: Lid opened.
Sep 30 08:13:03 systemd-logind[1290]: Lid closed. <- 10s after resume, within holdoff: no suspend
Sep 30 08:13:21 systemd-logind[1290]: Lid opened.
Sep 30 08:27:35 systemd-logind[1290]: Lid closed.
Sep 30 08:27:35 systemd-logind[1290]: Suspending...
Steps to reproduce
- In System Settings → Power Management, set "When the lid is closed" to "Do nothing" for battery and AC.
- With no external monitor attached, close the lid (more than 30s after boot or resume).
- The system suspends.
- Check with
systemd-inhibit --list: nohandle-lid-switchinhibitor is present.
Expected
When inhibit-lid-switch is true, csd-power holds a handle-lid-switch block inhibitor and applies the configured lid action itself, so "Do nothing" does nothing.
Actual
The inhibitor is missing, logind handles the lid with its own default, and the laptop suspends. The Power Management UI shows "Do nothing" with no warning that the setting isn't in effect.
Suggestions
- Find out why the inhibitor isn't taken, or is dropped, in this session (for example, after a resume or a monitor hotplug).
- Have the Power Management panel warn when the lid action can't be enforced, e.g. if csd-power has no lid inhibitor while logind's
HandleLidSwitchdiffers from the chosen action.
Workaround
Set HandleLidSwitch=ignore (and HandleLidSwitchExternalPower=ignore) in /etc/systemd/logind.conf.d/*.conf and reboot.
- Dominant language
- C
- Stars
- 70
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxmint/cinnamon-settings-daemon
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
linuxmint/cinnamon-settings-daemon#453 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
csd-power segfaults on idle dim when brightness is below minimum-display-brightness (NULL GError)Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
linuxmint/cinnamon-settings-daemon#474 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in linuxmint/cinnamon-settings-daemon
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
build help wanted new feature
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
AOMediaCodec/SVT-AV1#2516 · 2 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 4 days