[SOLVED] KDE suspend not working but pm-actions work fine - Slackware 13.37.0
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
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.
KDE suspend not working but pm-actions work fine - Slackware 13.37.0
Hi all,
I'm running Slackware 13.37.0 on a Dell Precision M65 laptop in runlevel 4 using kde and my user is a member of lp, plugdev, power, and netdev.
I can't seem to get the suspend to ram and suspend to disk items in the kmenu leave section to work. I can, however, su to root and run pm-suspend and pm-hibernate and both work perfectly since adding the append = "/dev/<swap partition>" line to lilo under the image line.
I've been chasing my tail trying to figure out how to change the methods used to perform suspending in the kmenu so it uses pm-actions but haven't gotten very far, maybe I'm missing something obvious, I've never dug into the power management stuff in KDE before. I added my user to the power and netdev groups, I watched ~/.xsession-errors when I tried using the KDE menu items, nothing really helpful shows. And in spite of searching all over the place I haven't figured out where the items in the leave portion of the KMenu are defined.
I'd really like to be able to have my laptop standby when I close the lid and hibernate when the battery is low without me being there to run pm-actions manually and, though I've found some similar posts around, I haven't found anything which was exactly this.
Power Management settings are configured yes. and it tries to do what I've told it to but at most it turns on the screensaver and locks the screen and flickers once.
Regardless, there is nothing in the Power Management console which allows me to tell it what command to use to achieve suspend to Ram or Suspend to Disk. If there was I would have already put pm-suspend and pm-hibernate in there.
Ok, looks like I've been approaching this from the wrong angle. It's a permissions issue. If I log into a kde session as root, suspend operations work as intended. So now It's just a matter of figuring out what the proper permissions changes are.
Anyone have any recommendations? pm.action has both user and group set to root currently. I imagine if I allow the power group execute permissions it should work. I suppose I'll give it a try.
I used the user permissions method, essentially using visudo and adding lines to allow the power group on my laptop to run pm-suspend and pm-hibernate without a password. ergo:
Quote:
%power ALL = NOPASSWD: /usr/sbin/pm-hibernate
%power ALL = NOPASSWD: /usr/sbin/pm-suspend
As I made my user a member of the power group previously, that's all that was left for me to do so my non-root user has proper power management while in KDE.
So for others trying to do this in Slackware 13.37:
Enable Suspend operations
Add
Quote:
"append - "resume=<swap partition>"
to lilo.conf after image line, of course replacing <swap partition> with the actual device name of the partition. Then run
Quote:
# lilo
Root will now be able to successfully run pm-suspend and pm-hibernate if your system supports it
Allow power group to run pm-hibernate and pm-suspend
As stated above, use visudo to modify the sudoers file and add the
Quote:
%power ALL = NOPASSWD: /usr/sbin/pm-hibernate
%power ALL = NOPASSWD: /usr/sbin/pm-suspend
lines. LEARN BASIC VI COMMANDS FIRST! If you're not familiar with it you'll get lost quickly and could seriously mangle the file. Especially if you're used to nano.
could you write precisely where to add this line in lilo and where precisely add lines with %power to sudoers?
This is lilo config file:
Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sdb
#compact # faster, but won't work on all systems.
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
# Append any additional kernel parameters:
append=" vt.default_utf8=0"
prompt
#timeout = 300
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sdb2
label = Slackware_S500
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
It should be there:
Code:
# Linux bootable partition config begins
image = /boot/vmlinuz
append - "resume=/dev/sdb1"
root = /dev/sdb2
label = Slackware_S500
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
Yes? And one more thing. You put something like this:
Quote:
append -
but on the internet people write
Quote:
append =
which is correct?
Thanks in an advance.
(btw - in my case, when i added
append - resume=/dev/sdb1
under
Quote:
# Append any additional kernel parameters:
my computer switched to a hibernation without problem but when i woke up it, slackware was loaded - resumed but as soon as image was loaded my LCD screen goes off and i can't enter slackware - numlock led is frozen, keyboard doesent react at all)
Looks like you have the append line in lilo.conf in the right place. I did make a typo, the line should be append =. That section of my lilo.conf looks like this:
Quote:
# End LILO global section
# Windows bootable partition config begins
other = /dev/sda2
Label = Windows
table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
append = "resume=/dev/sda6"
root = /dev/sda5
label = Linux
read-only
# Linux bootable partition config ends
Of course, I'm running a dual boot with a windows OS which I sometimes use for c# software development at work, hence the two sections I have. I know you didn't mention it, but to anyone who's not certain what their swap partition is, the easiest way to tell is to run
Yo can see that the first one listed is of type swap and is mounted as swap, hence my line in lilo.conf
As far as the /etc/sudoers file, I literally just appended the lines allowing the power group to call the pm-action symlinks (pm-hibernate and pm-suspend) at the bottom of the file. If you prefer, you could also add a third line for pm-suspend-hybrid, I hear that one can be iffy but so can the others if the system doesn't support them.
The issue where coming back from standby gives you a blank screen with numlock and capslock led's burning with no response I had on my kubuntu laptop a while back but I didn't know enough to troubleshoot it back then, so I'm not sure how much help I could be with that. If it's the same issue I had, you could plug in an external keyboard and (if your system manages to detect it) try hitting some keys to see if the screen is just locked.
if that allows you to get in after a restore I suppose you should check the ~/.xsession-errors and other log files for more clues about the cause of the issue.
EDIT: fixed a typo since cat doesn't work if it's entered as CAT and tried indenting things to make them look more like the terminal output but it looked worse so put it back.
Last edited by paladin.michael; 06-11-2011 at 01:02 PM.
This worked for me. Only thing I will add is /usr/sbin/ isn't in the default user PATH. So you need to somehow add pm-suspend and pm-hibernate to your PATH. I just appended PATH=$PATH:/usr/sbin/pm-suspend:/usr/sbin/PM-hibernate and it seems to work alright. Another option might be to write a script "pm-suspend" in your PATH that contains "& sudo /usr/sbin/pm-suspend" but maybe isn't the best practice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.