SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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:
Oh, sorry. I don't use pm-suspend/hibernate so it didn't realized at first what that meant.
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.
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.