![]() Registered Member ![]()
|
Does anyone know how to manage power when multiple user accounts are running simultaneously?
What I want to accomplish is to have the machine go to sleep after 60 minutes with no activity FROM ANY USER. Like global system power management. This works fine with one user logged on. But if multiple users are logged on the power management for each seems to want to work independently of the other creating conflicts. For example: Power management is set to lock the screen after 5 min and put the system to sleep after 60 min, for user A who logs in. User A's screen becomes locked (lets say via manual screen lock). 10 mins later user B comes along and logs in with same power management settings as user A. User B then continues to work for 50 min. At this time the 60 min timeout for user A power management tries to put the system to sleep (no activity for user A) even though user B is actively working. Power management (user A) requires root permisions (user A shouldn't be allowed to force sleep for all users - right?) and a dialog pops up in the locked session asking for root password. But user A is not around and doesn't have root anyway. Then user B locks screen and walks away. After 60 mins user B power management tries to put the system to sleep - again requiring root! Quickly the whole thing becomes totally confused and the system will not sleep at all!! How can I get power management of the system so that it goes to sleep when there is no activity from user A and B and C etc etc etc? ie no activity from ANY user = sleep Anybody? Eric KDE 4.8 OpenSuse 11.2 x64 |
![]() Administrator ![]()
|
KDE Power Management can only shutdown the system if PolicyKit grants it the authority to do so.
By default, only the active user usually has the permission to do this, although if PolicyKit is not permitted to do this, then this will not occur.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks bcooksley I suspected this was the situation. So . . .isn't this a very poor way to manage "system" power? Or perhaps it is better to ask if KDE is poorly designed if it can only manage power on the user level and lacks completely the ability to manage power on a system wide basis. I find it hard to believe I'm the only one running multiple users and wanting to manage power. Has nobody really even thought about this? I also suspect there is a way to make this work. Maybe I can inspire additional responses or even development by noting that Windows does this perfectly . . .and NO i'm not going to use it anyway. Suggestions would be greatly appreciated! |
![]() Administrator ![]()
|
KDE only has control over the user session, and as such can only provide Power Management from that level. Further, in order to provide some of it's functionality, it must be part of the user session.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Hmmm I see. A SERIOUS shortcoming! That basically means KDE is only fully functional for a single user. Pretty weak for a modern desktop env! There must be a way!!
Anybody? |
![]() Administrator ![]()
|
It's not a "fault" of KDE, but rather how the underlying stack works.
"Violence is the last refuge of the incompetent."
![]() Plasma FAQ maintainer - Plasma programming with Python |
![]() Registered Member ![]()
|
As a user, and not a developer, I have to admit i do not understand the technical details. The fault may be a "how the underlying stack works" but from a user perspective the result is the same - functionality limited to a single user.
It may seem like a minor issue, and I love Linux/KDE and will continue to be an enthusiastic user and proponent. However power management is a VERY important basic feature. Being able to run multiple users is also! I do not think the two should be mutually exclusive and regardless of where the fault lies it is a serious shortcoming. I think if KDE wants to be taken seriously it's developers should think seriously about finding a way to make both work. There must be a way! Anybody? |
![]() KDE Developer ![]()
|
First of all, if you admit you are a user and not a developer, please avoid judging how good the design currently is, since you don't have arguments to back your statement. That said, you completely misunderstood Ben's answer (Ben, anyway, policykit does not take part in this decision) and the concept behind multi-user power management. Explanation follows.
1. Power management in KDE is in the userspace (like everywhere else in Linux) ONLY for the policy handling part. The daemon is nothing but an agent invoking underlying kernel/system space tools, which do not belong to KDE but to the kernel or some middleware stack 2. KDE Power management SUPPORTS multiple users, IF ConsoleKit is up and running. In this situation (multiple users logged in) *ONLY* the currently active user determines the policy for power management. So if user A, B and C are logged in and C is active, C's configuration will take over. In general, only active consoles are capable of acting on power management. 3. The behavior above is not a limitation coming from how the system is designed but intended behavior. The whole concept of managing power with multiple users is totally broken, and the policy MUST always be controlled by a single user. Imagine 3 people in the same room with a single light switch: one is reading, one is sleeping, one is playing a game on his PC. No situation will be a proper fit for everyone, so somebody has to take the lead. This is exactly the problem with multiple users. Moreover, our case is even simpler, because there might be 14 users logged in, but in the case of a desktop/laptop, only one will be active. If this is not true, you should consider not managing power at all since you're no longer in the desktop case. 4. The fact the agent lives in userspace has nothing to do with this discussion as it should clear by now. The paradox is that if you were to move ALL of the logic to a system-wide level, you would lose the possibility of configuring different policies for different users, something you can do reliably now. 5. If you explained yourself badly and what you wanted to do is exactly what I described in point 4, then simply move the configuration which should be applied "systemwide" to /etc, so that it can cascade. It's that simple, KConfig and Kiosk will take care of the rest without you even noticing. |
![]() Registered Member ![]()
|
First off THANK YOU for your explanation!
Apologies for any misunderstanding but my judgments are only regarding my experience as a user - as I clearly stated. The argument to back up my statement is simple - as is power management does not do what I want it to. Its virtually impossible to explain myself correctly not understanding the technical details - agreed? That's why I'm here asking for help. What I want seems simple and logical (to me as a user). Lets use your scenario of 3 people in a room as an example. situation 1: one person is reading, one is sleeping, one is playing a game on his PC. No situation will be a proper fit for everyone, so somebody has to take the lead. OK here the lights need to be on because there is activity - right? Sleeping person can still close his/her eyes. situation 2: Everybody is asleep. No activity. Save energy and turn off the lights! I think if this were your house you would do the same thing. That is all I want to do. So yes I believe what I want is what you described in point number 4. One last point relating to your statement in #4 " . . .lose the possibility of configuring different policies for different users, something you can do reliably now." You can do it but NOT RELIABLY when multiple users are logged in. The active user policy DOES NOT take over or "take the lead" as you put it. The end result is that NONE of the user configurations work. No judgement just simple observation of the system behavior. In that case you lose the possibility of configuring different policies for different users anyway. Its the same as having no configuration at all. Apologies again for my ignorance! And thanks again for your time and effort to explain this. |
![]() ![]()
|
I'm going to take a guess here and suspect that you'd prefer a more Windows-like experience for managing system-wide configurations. Well, this is one area where a graphical DE on Linux deviates from Windows.
In Linux-based operating systems, the DE operates entirely within userspace, like Dario mentioned. As such, you should think of the DE as wholly personal for each individual user. To manage system-wide settings and have those settings apply to all users, it's necessary to go outside the DE. Now, contrast this with Windows, where the DE (which, loosely defined, is managed by the first instance of explorer.exe that runs when you boot your computer) is essentially embedded into the base operating system and thus somewhat blurs the distinction between the OS and the DE. I don't think it's fair to criticize KDE for the way it behaves. KDE and Linux aren't Windows, and some things are simply going to behave differently. Power management through the GUI is one such example. I'm interested to learn more about your usage scenario. What's the reason for maintaining multiple simultaneous logons to a personal computer? I'm just curious, that's all, becuase I don't think this is a very common thing anymore. |
![]() Registered Member ![]()
|
Well I have a family and everybody uses the computer. I use it for my job (structural biology) among other things, my wife and kids use it for web, word processing multimedia etc. I'm the "administrator" with root access and I want to keep my system safe so I can do my job at home when i need to, and I want to keep my work separate from the other users. If i'm in the middle of some work and my wife needs to get a recipe online or my daughter wants to check facebook I can lock my session and walk away without worry while she does her thing. Seems like a pretty common home situation. At the workplace our scientific workstatoins running KDE all support multiple logins and we'd be F'd if they didn't . . . we just dont ever put the machines to sleep so the power management issue is irrelevant. . . so much for reducing carbon footprints! At home i pay the electricity bill and I also care about doing my part to reduce global warming. So anyway in my world its common. In a sense you are right - I want KDE/Linux to act more like windows in this one respect. Maybe windows got 1 thing right? Having said that, I've done everything I can to get away from windows and i'm not going back. I certainly don't expect KDE/Linux to behave like windows, I just expect them to work in a useful way!!! One reason I prefer Linux is because I find that, more often than not, if you want it to do something you can find a way if you try and you dont have to pay a bunch of money for some bloated barely usable software. Thats part of why open source is so great. Again I love KDE, and I love Linux. Just don't start crying "its not fair" when someone is critical. Its not only fair to be critical its absolutely needed! Its intended as constructive criticism and KDE/Linux will be better for it. Isn't that a large part of why this forum exists? |
![]() ![]()
|
Ah, I see...I suppose my view on this is influenced by a difference in our environments. No shared computers, either at home or at work.
I guess the price we pay for having the flexibility of DEs that are "farther away" from the underlying OS is the loss of some amount of DE/OS integration. I re-read your original post and compared to what Dairo wrote; his explanation #2 sounds like what you want but it appears you're seeing not that -- did I get it right? The currently active user's profile should own the behavior, but the dialog boxes popping up asking for root are preventing that from happening. Perhaps some code could be written to catch and avoid this -- I'm not really sure.
Heh...the move from Windows to Linux (and KDE) was a major one for me. I worked for Microsoft from 1998 to 2009 and have spent most of my life running Windows. I switched to Ubuntu in early 2010 and then Kubuntu shortly after that. |
![]() Registered Member ![]()
|
Yes Dario's #2 was what I thought should happen intuitively. The active user's profile should own the behavior. It tries but it DOES NOT and you are exactly correct; the dialog boxes popping up asking for root (in the locked session) are preventing that from happening. I will try moving "the configuration which should be applied "systemwide" to /etc, so that it can cascade." As per Darios suggestion in #5 and see if that gets me a useful / desired behavior. Cheers! |
![]() Registered Member ![]()
|
Dario et al OK I tried moving the config to /etc and the behavior is virtually the same! ie it still does not work. Here is a description: 1 ) bootup machine and login as userA (vt7) 2 ) configure userA power settings to put the system to sleep after 30 seconds and nothing else - apply setting. 3 ) wait 30 seconds -> system goes to sleep -> wake system 4 ) unlock screen, logout, open a new session as userB (vt7), and repeat steps 2) and 3) as userB. OK at this point power management is working perfectly for userA and userB as system sleeps after 30 seconds inactivity. It works for user A, B, C ,D etc when only a single user is logged in. Now lets move the config to /etc and see what happens. 5 ) login as userA 6 ) as root copy /home/userA/.kde4/share.config/powermanagementprofilesrc to /etc/kde4/share/config/powermanagementprofilesrc 7 ) configure userA power setting by deselecting any actions (unchecking all boxes under battery monitor -> configure power management -> energy saving settings) 8 ) logout and log back in, wait 30 seconds, system goes to sleep. 9 ) logout and login as userB 10 ) repeat steps 7 ) and 8 ) for userB OK userA and userB are configured to do nothing, the configuration from /etc is putting the system to sleep after 30 seconds of inactivity. Great! So far . . . Now lets see what happens with multiple logins! 11 ) logout of all sessions 12 ) login as userA (vt7) and confirm system sleeps after 30 seconds -> confirmed -> wake system and unlock screen 13 ) Alt+F2 -> type "new session" -> press enter and login as userB (vt8), wait 30 seconds 14 ) system DOES NOT sleep after 30 seconds, but screen turns off. 15 ) wiggle mouse and screen turns on, ctl+alt+F7 to switch to vt7 userA session 16 ) dialog box has popped up asking for root password to authenticate for putting sytem to sleep. 17 ) in dialog box select "remember authentication" checkbox and do not select "for this session only" checkbox, enter root password and click ok. 18 ) system immediately sleeps 19 ) wake system by pressing power button -> system wakes and session resumes (session is NOT locked as usual) 20 ) ctl+alt+F8 to switch back to vt8 userB session, wait 30 seconds -> system DOES NOT sleep but screen turns off. 21 ) repeat steps 15) and 16) Again the dialog box has popped up asking for root password to authenticate even though I had previously selected "remember authentication". So I may be just a USER but PLEASE somebody tell me this is NOT the way power management was designed to work! Or am I missing something? Why even have a checkbox for "remember authentication"and "for this session only" if they do not do anything?? Is there any question power managemnet is broken with multiple logins? Am I doing something wrong? Any help??? |
![]() KDE Developer ![]()
|
I smell trouble here. Which distribution are you on? Please, try running this command from terminal:
And paste the output here. If your ConsoleKit is instead running correctly, then this is a bug which should be reported and fixed. |
Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]