Summary: | Power management broken with multiple users | ||
---|---|---|---|
Product: | [Frameworks and Libraries] solid | Reporter: | Eric Johnson <emailej> |
Component: | powermanagement | Assignee: | Dario Freddi <drf> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | emailej, myriam, oliver.henshaw, rdieter |
Priority: | NOR | ||
Version: | 4.9.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
URL: | http://forum.kde.org/viewtopic.php?f=66&t=101442 | ||
See Also: | https://bugzilla.novell.com/show_bug.cgi?id=734829 | ||
Latest Commit: | http://commits.kde.org/kde-workspace/c7b72b6f6707df83b52c18ac74a9932488968895 | Version Fixed In: | 4.9.3 |
Attachments: | text file containing contents of all files with string "org.freedesktop.upower" |
Description
Eric Johnson
2012-04-24 04:05:10 UTC
Which exact KDE version is this about? Please set the version field. Did you read the last line in the bug report? "This seems to be a long standing bug persisting through kde 4 releases." In fact I tend to upgrade my kde as new releases become available and I have observed this behavior for as long as I can remember using KDE 4.x (after many years of KDE 3.x). So pick a KDE 4.x version and you will find the bug. Having said that, the precise tests described in the bug were done using kdebase4-runtime-4.7.4 as installed from the following repository: http://download.opensuse.org/repositories/KDE:/Release:/47/openSUSE_11.4/x86_64/ (In reply to comment #1) > Which exact KDE version is this about? Please set the version field. Did you read the last line in the bug report? "This seems to be a long standing bug persisting through kde 4 releases." In fact I tend to upgrade my kde as new releases become available and I have observed this behavior for as long as I can remember using KDE 4.x (after many years of KDE 3.x). So pick a KDE 4.x version and you will find the bug. Having said that, the precise tests described in the bug were done using kdebase4-runtime-4.7.4 as installed from the following repository: http://download.opensuse.org/repositories/KDE:/Release:/47/openSUSE_11.4/x86_64/ (In reply to comment #1) > Which exact KDE version is this about? Please set the version field. Thank you for the feedback. JFYI: the current stable KDE release is 4.9.1 so it would be really useful to know if this still applies, since there have been quite some changes in that code in KDE 4.8.x... (Not an expert, found this bug while researching an unrelated power management bug). The part where the other session pops up a root password dialog suggests this is may be polkit related (I think opensuse uses polkit, right?). The policy on my (fedora) system simply allows suspend on active sessions and disallows it on inactive ones, but I think it would be possible to write a policy that asks for a root password in some situations. It would be interesting to see the contents of all files that contain the string "freedesktop.upower" in /usr/share/polkit-1 or /etc/polkit-1 or /var/lib/polkit-1. (In reply to comment #4) > Thank you for the feedback. JFYI: the current stable KDE release is 4.9.1 so > it would be really useful to know if this still applies, since there have > been quite some changes in that code in KDE 4.8.x... Have now updated to the latest KDE 4.9.1 with the following repository: http://download.opensuse.org/repositories/KDE:/Release:/49/openSUSE_12.1/ Behavior described above still persists. Please also see comments #5 and reply. Thanks! Created attachment 74043 [details]
text file containing contents of all files with string "org.freedesktop.upower"
(In reply to comment #5) > (Not an expert, found this bug while researching an unrelated power > management bug). > > The part where the other session pops up a root password dialog suggests > this is may be polkit related (I think opensuse uses polkit, right?). The > policy on my (fedora) system simply allows suspend on active sessions and > disallows it on inactive ones, but I think it would be possible to write a > policy that asks for a root password in some situations. > > It would be interesting to see the contents of all files that contain the > string "freedesktop.upower" in /usr/share/polkit-1 or /etc/polkit-1 or > /var/lib/polkit-1. Oliver, Thanks much for your insight here. Yes Suse does use polkit and you are probably right that this is polkit related. I'm pasting below the contents of all files that contain the string "freedesktop.upower" in /usr/share/polkit-1 or /etc/polkit-1 or /var/lib/polkit-1. format is: file path followed by file contents. Also attached as a text file in case email formatting does something weird. Would greatly appreciate if anyone can make sense of this. Cheers, Eric /usr/share/polkit-1/org.freedesktop.upower.qos.policy <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> <policyconfig> <vendor>The UPower Project</vendor> <vendor_url>http://upower.freedesktop.org/</vendor_url> <icon_name>system-suspend</icon_name> <action id="org.freedesktop.upower.qos.request-latency"> <description>Set the required latency of an application</description> <description xml:lang="fr">Définir la latence requise d'une application</description> <description xml:lang="it">Imposta la latenza richiesta di un'applicazione</description> <description xml:lang="pl">Ustawienie wymaganego opóźnienia programu</description> <description xml:lang="sv">Ställ in nödvändig fördröjning för ett program</description> <message>Authentication is required to set the required latency of an application</message> <message xml:lang="fr">Vous devez vous identifier pour définir la latence requise d'une application</message> <message xml:lang="it">È richiesto autenticarsi per impostare la latenza richiesta di un'applicazione</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby ustawić wymagane opóźnienie programu</message> <message xml:lang="sv">Autentisering krävs för att ställa in nödvändig fördröjning för ett program</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults> </action> <action id="org.freedesktop.upower.qos.request-latency-persistent"> <description>Set a persistent latency setting</description> <description xml:lang="fr">Définir une latence persistante</description> <description xml:lang="it">Imposta una impostazione di latenza duratura</description> <description xml:lang="pl">Ustanowienie ustawienia trwałego opóźnienia</description> <description xml:lang="sv">Ställ in en bestående fördröjningsinställning</description> <message>Authentication is required to set a persistent latency setting</message> <message xml:lang="fr">Vous devez vous identifier pour définir de latence persistante</message> <message xml:lang="it">È richiesto autenticarsi per impostare una impostazione di latenza duratura</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby ustanowić trwałe ustawienie opóźnienia</message> <message xml:lang="sv">Autentisering krävs för att ställa in en bestående fördröjningsinställning</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults> </action> <action id="org.freedesktop.upower.qos.set-minimum-latency"> <description>Set administrator settings for latency control</description> <description xml:lang="fr">Définir les paramètres administrateur pour le contrôle de la latence</description> <description xml:lang="it">Imposta le impostazioni di amministrazione per il controllo della latenza</description> <description xml:lang="pl">Ustanowienie ustawień administratora do kontroli opóźnienia</description> <description xml:lang="sv">Ställ in administratörsinställningar för fördröjningskontroll</description> <message>Authentication is required to set administrator settings for latency control</message> <message xml:lang="fr">Vous devez vous identifier pour définir les paramètres administrateur de contrôle de latence</message> <message xml:lang="it">È richiesto autenticarsi per impostare le impostazioni di amministrazione per il controllo della latenza</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby ustanowić ustawienia administratora do kontroli opóźnienia</message> <message xml:lang="sv">Autentisering krävs för att ställa in administratörsinställningar för fördröjningskontroll</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> </defaults> </action> <action id="org.freedesktop.upower.qos.cancel-request"> <description>Cancel a latency request</description> <description xml:lang="fr">Annuler une demande de latence</description> <description xml:lang="it">Annulla una richiesta di latenza</description> <description xml:lang="pl">Anulowanie żądania opóźnienia</description> <description xml:lang="sv">Avbryt en fördröjningsbegäran</description> <message>Authentication is required to cancel a latency request</message> <message xml:lang="fr">Vous devez vous identifier pour annuler une demande de latence</message> <message xml:lang="it">È richiesto autenticarsi per annullare una richiesta di latenza</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby anulować żądanie opóźnienia</message> <message xml:lang="sv">Autentisering krävs för att avbryta en fördröjningsbegäran</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> </defaults> </action> </policyconfig> /usr/share/polkit-1/org.freedesktop.upower.policy <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> <policyconfig> <vendor>The UPower Project</vendor> <vendor_url>http://upower.freedesktop.org/</vendor_url> <icon_name>system-suspend</icon_name> <action id="org.freedesktop.upower.suspend"> <description>Suspend the system</description> <description xml:lang="fr">Mettre le système en veille</description> <description xml:lang="it">Sospende il sistema</description> <description xml:lang="pl">Wstrzymanie systemu</description> <description xml:lang="sv">Försätt systemet i vänteläge</description> <message>Authentication is required to suspend the system</message> <message xml:lang="fr">Vous devez vous identifier pour mettre le système en veille</message> <message xml:lang="it">È richiesto autenticarsi per sospendere il sistema</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby wstrzymać system</message> <message xml:lang="sv">Autentisering krävs för att försätta systemet i vänteläge</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults> </action> <action id="org.freedesktop.upower.hibernate"> <description>Hibernate the system</description> <description xml:lang="fr">Mettre le système en hibernation</description> <description xml:lang="it">Iberna il sistema</description> <description xml:lang="pl">Hibernacja systemu</description> <description xml:lang="sv">Försätt systemet i viloläge</description> <message>Authentication is required to hibernate the system</message> <message xml:lang="fr">Vous devez vous identifier pour mettre le système en hibernation</message> <message xml:lang="it">È richiesto autenticarsi per ibernare il sistema</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby zahibernować system</message> <message xml:lang="sv">Autentisering krävs för att försätta systemet i viloläge</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults> </action> </policyconfig> /var/lib/polkit-1/org.freedesktop.upower.qos.cancel-request.pkla [org.freedesktop.upower.qos.cancel-request] Identity=unix-group:* Action=org.freedesktop.upower.qos.cancel-request ResultAny=auth_admin ResultInactive=auth_admin ResultActive=auth_admin var/lib/polkit-1/org.freedesktop.upower.hibernate.pkla [org.freedesktop.upower.hibernate] Identity=unix-group:* Action=org.freedesktop.upower.hibernate ResultAny=auth_admin ResultInactive=auth_admin ResultActive=yes var/lib/polkit-1/org.freedesktop.upower.suspend.pkla [org.freedesktop.upower.suspend] Identity=unix-group:* Action=org.freedesktop.upower.suspend ResultAny=auth_admin ResultInactive=auth_admin ResultActive=yes var/lib/polkit-1/org.freedesktop.upower.qos.request-latency.pkla [org.freedesktop.upower.qos.request-latency] Identity=unix-group:* Action=org.freedesktop.upower.qos.request-latency ResultAny=auth_admin ResultInactive=auth_admin ResultActive=yes var/lib/polkit-1/org.freedesktop.upower.qos.set-minimum-latency.pkla [org.freedesktop.upower.qos.set-minimum-latency] Identity=unix-group:* Action=org.freedesktop.upower.qos.set-minimum-latency ResultAny=auth_admin ResultInactive=auth_admin ResultActive=auth_admin var/lib/polkit-1/org.freedesktop.upower.qos.request-latency-persistent [org.freedesktop.upower.qos.request-latency-persistent] Identity=unix-group:* Action=org.freedesktop.upower.qos.request-latency-persistent ResultAny=auth_admin ResultInactive=auth_admin ResultActive=yes END (In reply to comment #8) > Would greatly > appreciate if anyone can make sense of this. > > > /usr/share/polkit-1/org.freedesktop.upower.policy > [...] > <action id="org.freedesktop.upower.suspend"> > <description>Suspend the system</description> > [...] > <defaults> > <allow_inactive>no</allow_inactive> > <allow_active>yes</allow_active> > </defaults> > </action> This is what I have in fedora. > var/lib/polkit-1/org.freedesktop.upower.suspend.pkla > > [org.freedesktop.upower.suspend] > Identity=unix-group:* > Action=org.freedesktop.upower.suspend > ResultAny=auth_admin > ResultInactive=auth_admin > ResultActive=yes This looks like the immediate cause of the problem. ResultInActive=auth_admin means that it will ask for a root password from an active local (and specifically not remote) session, if I understand correctly. This doesn't make any sense to me, since how can someone not in front of the computer enter a root password? Is this a system provided file or one you've created/edited yourself? You can check with 'rpm -qf FILE' and then 'rpm -qV PACKAGE'. If it does come from opensuse, could you file a bug asking whether "ResultInactive=auth_admin" makes any sense. That said, I think powerdevil is handling this badly too. I think this was caused by commit 2606ff0045470d360a2ad4ad8aeb2819f653676f - an attempt to fix an issue that was probably better fixed by commit d30b646dd83b81f750d786dab08a91dba7c49f3a - if I'm reading this right, Powerdevil attempts to autosuspend the system even when the session is inactive. Normally polkit disallows this and no harm is done. But on your system it brings up a root dialogue on the inactive session, and obviously an inactive session will idle out before an active one. The third problem is that a root dialogue on the inactive session might be annoying but it shouldn't block polkit-allowed actions in the active session. I can't see any reason why powerdevil should be to blame for this, but maybe someone more familiar with the code might: for now I'm going to blame polkit. Bug 295381 describes the same issue: the reporter notes problem #1 and posits problem #3 as the central bug. See also bug 294712 for other issues with upower and polkit authentication. Also described in opensuse bugzilla report: Bug 734829 - kde: suspend does not work if more then one kde session is running https://bugzilla.novell.com/show_bug.cgi?id=734829 Please set this bug as "Status: CONFIRMED"! Setting status correctly. (In reply to comment #9) > (In reply to comment #8) > > That said, I think powerdevil is handling this badly too. I think this was > caused by commit 2606ff0045470d360a2ad4ad8aeb2819f653676f - an attempt to > fix an issue that was probably better fixed by commit > d30b646dd83b81f750d786dab08a91dba7c49f3a - if I'm reading this right, > Powerdevil attempts to autosuspend the system even when the session is > inactive. Normally polkit disallows this and no harm is done. But on your > system it brings up a root dialogue on the inactive session, and obviously > an inactive session will idle out before an active one. https://git.reviewboard.kde.org/r/107022/ Git commit c4391232658790b471d4e3eddf76a31e6a8e2694 by Oliver Henshaw. Committed on 24/10/2012 at 15:05. Pushed by oliverhenshaw into branch 'push/4.9'. Don't give InterruptSession special treatment Revert "Override ck check if the last active user requested to shutdown the session." and matching check in systemd support. Allowing InterruptSession when another consolekit/loginctl session is Active means that PowerDevil may attempt to autosuspend the system from the Inactive session. Normally polkit disallows this and no harm is done but some systems have a "ResultInactive=auth_admin" policy. This will bring up a root dialogue on the inactive session, which is annoying and unnecessary at best. Due to a (upower?) bug this will also block upower suspend actions in the active session. This reverts commit 2606ff0045470d360a2ad4ad8aeb2819f653676f. It's not clear whether https://bugs.kde.org/show_bug.cgi?id=277774 was ever fixed by that commit. REVIEW: 107022 M +2 -2 powerdevil/daemon/powerdevilpolicyagent.cpp http://commits.kde.org/kde-workspace/c4391232658790b471d4e3eddf76a31e6a8e2694 Git commit c7b72b6f6707df83b52c18ac74a9932488968895 by Oliver Henshaw. Committed on 24/10/2012 at 15:05. Pushed by oliverhenshaw into branch 'master'. Don't give InterruptSession special treatment Revert "Override ck check if the last active user requested to shutdown the session." and matching check in systemd support. Allowing InterruptSession when another consolekit/loginctl session is Active means that PowerDevil may attempt to autosuspend the system from the Inactive session. Normally polkit disallows this and no harm is done but some systems have a "ResultInactive=auth_admin" policy. This will bring up a root dialogue on the inactive session, which is annoying and unnecessary at best. Due to a (upower?) bug this will also block upower suspend actions in the active session. This reverts commit 2606ff0045470d360a2ad4ad8aeb2819f653676f. It's not clear whether https://bugs.kde.org/show_bug.cgi?id=277774 was ever fixed by that commit. REVIEW: 107022 (cherry picked from commit c4391232658790b471d4e3eddf76a31e6a8e2694) M +2 -2 powerdevil/daemon/powerdevilpolicyagent.cpp http://commits.kde.org/kde-workspace/c7b72b6f6707df83b52c18ac74a9932488968895 Confirmed power management is working as expected under KDE 4.9.3, open Suse 12.1 and 12.2 after commit! Finally my system sleeps as expected. Hope it sticks in today's release of 4.9.4. Thanks to everyone for helping with this bugfix and making KDE better: Oliver Henshaw, Myriam Schweingruber, Dario Freddi and anyone else I'm forgetting. Thank you and long live KDE! Eric |