Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logind: Doesn't inhibit suspend when inhibited in the same session #29818

Open
agx opened this issue Nov 1, 2023 · 0 comments
Open

logind: Doesn't inhibit suspend when inhibited in the same session #29818

agx opened this issue Nov 1, 2023 · 0 comments
Labels
bug 🐛 Programming errors, that need preferential fixing login

Comments

@agx
Copy link
Contributor

agx commented Nov 1, 2023

systemd version the issue has been seen with

254

Used distribution

Debian

Linux kernel version used

6.5.0-2-amd64

CPU architectures issue was seen on

None

Component

systemd-logind

Expected behaviour you didn't see

Adding a sleep inhibitor as user like

systemd-inhibit --what=sleep --mode=block bash

and then issuing suspend:

busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager SuspendWithFlags t 1

in the same session should prevent suspend as there is an inhibitor set.

Unexpected behaviour you saw

The above does not prevent suspend for me.

(systemctl suspend does inhibit suspend but that's because it checks for inhibitors first.)

Steps to reproduce the problem

See above under "expected behaviour".

Additional program output to the terminal or log subsystem illustrating the issue

No response

@agx agx added the bug 🐛 Programming errors, that need preferential fixing label Nov 1, 2023
@github-actions github-actions bot added the logind label Nov 1, 2023
agx added a commit to agx/phosh that referenced this issue Jan 19, 2024
The systemd inhibitor would ensure we don't suspend when e.g. another
session is active. What we're interested about here is the user's
session though so use gnome-session to prevent suspend instead.

We use a sync DBus call here which should be fine and not block and we
can't do much without gnome-session running anyway.

For the systemd bits see systemd/systemd#29818

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1001
Part-of: <https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1339>
@mrc0mmand mrc0mmand added login and removed logind labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing login
Development

No branches or pull requests

2 participants