[systemd-bugs] [Bug 66321] New: shutdown-inhibitor from user session is ignored when calling org.freedesktop.login1.Manager.Suspend or org.freedesktop.login1.Manager.PowerOff
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Jun 28 06:43:53 PDT 2013
https://bugs.freedesktop.org/show_bug.cgi?id=66321
Priority: medium
Bug ID: 66321
Assignee: systemd-bugs at lists.freedesktop.org
Summary: shutdown-inhibitor from user session is ignored when
calling org.freedesktop.login1.Manager.Suspend or
org.freedesktop.login1.Manager.PowerOff
QA Contact: systemd-bugs at lists.freedesktop.org
Severity: normal
Classification: Unclassified
OS: Linux (All)
Reporter: alexander.grothe at gmail.com
Hardware: x86-64 (AMD64)
Status: NEW
Version: unspecified
Component: general
Product: systemd
Hello,
I am running Arch Linux with systemd-204
(https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/systemd&id=770b03b35a8c53b5d5e23738ae66138856aebf3e)
and a gnome-session started by gdm (version 3.8.3).
I am trying to use a shutdown-inhibitor which reliably blocks a shutdown or
suspend if a script running in the background within the session is busy.
So I set up a "block" mode inhibitor from a terminal:
$ systemd-inhibit --who=test vim
It showed up correctly:
$ systemd-inhibit --list
[...]
Who: test (UID 1000/alexander, PID 547/systemd-inhibit)
What: shutdown:sleep:idle
Why: Unknown reason
Mode: block
systemctl itself respects this inhibitor:
$ systemctl poweroff
Operation inhibited by "test" (PID 547 "systemd-inhibit", user alexander),
reason is "Unknown reason".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
But when calling login1 directly, the system is shut down without further
notice or authorization request(for example XBMC uses a dbus command like
this):
$ dbus-send --system --print-reply --dest=org.freedesktop.login1
/org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:false
If the inhibitor is set by root, both "systemctl poweroff" and a dbus-request
show the expected behavior:
# systemd-inhibit --who="test as root" vim
$ systemctl poweroff
Operation inhibited by "test as root" (PID 564 "systemd-inhibit", user root),
reason is "Unknown reason".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
$ dbus-send --system --print-reply --dest=org.freedesktop.login1
/org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:false
Error org.freedesktop.DBus.Error.AccessDenied: Operation not permitted
I is possible that all inhibitor are reliably taken into account for
org.freedesktop.login1.Manager.* calls, regardless of the owner?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130628/38bcd9be/attachment.html>
More information about the systemd-bugs
mailing list