SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm still learning my way with my Thinkpad T400. I seem to lack the big picture with suspend to ram.
I probably missed another memo somewhere. When I run upower -d as non-root, the output reveals the user does not have permission to suspend (can-suspend: no). The account is a member of the power and plugdev group.
pm-suspend is installed at /usr/sbin rather than /usr/bin and the script won't let non-root users execute. pm-suspend works fine as root.
/sys/power/state has permissions of 644, root:root. Of course, with those permissions I can't change the contents as non-root.
All scripts in /usr/lib/pm-utils are executable with 755 permissions.
Full install, so upower, et. al., are installed.
I've been browsing the forum and web to no avail. How do I programmatically execute suspend to ram as a non root user? I have the lid configured as well as Fn-F4, but want to have programmatic access too (can-suspend: yes).
Are you saying a non-root user has to type that entire gobbledygook string to suspend to ram? Or place that string into a script wrapper? Even if a non-root does that, upower -d still informs that the user does not have permissions. What is needed to obtain those permissions?
Note: when I run the gobbledygook above I receive a stdout message of "not authorized," which matches the upower -d output of can-suspend: no.
I'm afraid I can't test this now but give this a shot, put the following in: /etc/polkit-1/localauthority/50-local.d/30-power-group.suspend-override.pkla
Code:
[Suspend power group override]
Identity=unix-group:power
Action=org.freedesktop.upower.suspend
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Thanks. That pkla file did the trick. Now upower -d shows can-suspend: yes. No reboot required, just logout/login.
Now, where in the Slackware documentation would I have found that solution?
I'm still confused. Most people using a laptop don't run as root. So why is this pkla policy not standard? How do folks use various graphical applets to suspend to ram when this policy is not present? Yeah, okay, most folks just close the lid, but for me to even get that to work I had to spend time on the web to learn how to add various acpi scripts. I find acpi on laptops to be ridiculously complicated. Suspend to ram on a laptop does not "just work" on linux based systems.
I think it's just a permissions thing in the /proc and /sys files that actually do the suspend/hibernation. If you chown/chmod those at boot you should be able to suspend as normal user like I do. My suspend script:
When I run upower -d I see the following at the end:
can-suspend: no
Oh, sorry. I don't use pm-suspend/hibernate so it didn't realized at first what that meant.
Quote:
Originally Posted by Woodsman
Are you saying a non-root user has to type that entire gobbledygook string to suspend to ram? Or place that string into a script wrapper?
I use bash script as wrapper and as far as I know, there isn't better way. I don't like it much either, but once it's set up, it just works I have menu entry for suspend and hibernation in Fluxbox and sometimes I forget that these scripts are there.
I wonder why it doesn't work on your system. On both 14.0 and current it works like a charm without any polkit configuration file. It works from either console or XFCE logout GUI, which I believe uses the same thing under the hood.
Well, sort of --- to experienced users. My "confusion" is why aren't those settings the default? This is similar to Torvalds' rant months ago about not letting non-root users configure printers.
Well, sort of --- to experienced users. My "confusion" is why aren't those settings the default? This is similar to Torvalds' rant months ago about not letting non-root users configure printers.
Is your slackware 14.0 clean install or upgraded from previous version? I just checked one machine with slack 14.0 (32 bit, but it shouldn't matter) and it lets me suspend or hibernate as regular user. Well, suspend doesn't work quite right as it freeze on black screen after wakeup, but at least it lets me suspend system to ram.
Are you sure you don't have any leftover or old configuration files from older slack?
On my eeepc, suspend works fine from the lid and the dock on XFCE when I got the appropriate environment running on the stock Slackware 14.0. I have my eeepc set up this way so the wife won't get frustrated with me. I think some of this polkit desktop integration must be untested, as I've seen your question asked before (why permissions for can-suspend is no for no good reason). If I was in your boat, I would probably be ranting like Torvalds.
I'm not sure what DE your are using. If you are using XFCE, I am seriously contemplating forking xfce4-session to bypass polkit/consolekit for stuff like suspend when I upgrade to Slackware 14.1. I'm doing this to try to get a system that is future proof to this userspace madness. This should make the same functions transparent to less experience users, and work at least more often than polkit.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.