LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having 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


Reply
  Search this Thread
Old 06-09-2011, 10:50 AM   #1
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 75

Rep: Reputation: 23
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.

Does anyone have any idea what I'm missing?
 
Old 06-10-2011, 08:50 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Have you been configuring the KDE power management options via System Settings -> Power Management?
 
Old 06-10-2011, 09:23 AM   #3
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 75

Original Poster
Rep: Reputation: 23
Power Management set up, doesn't help.

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.

Click image for larger version

Name:	Power Management.png
Views:	55
Size:	68.1 KB
ID:	7273

when on battery it's using powersave.
 
Old 06-11-2011, 03:10 AM   #4
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 75

Original Poster
Rep: Reputation: 23
It's permissions, not PowerDevil configuration.

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.
 
Old 06-11-2011, 03:49 AM   #5
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 75

Original Poster
Rep: Reputation: 23
Cool Solution found

Ok, found my answer here...

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:
  1. 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
  2. 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.
  3. Add your non-root user to the power group
    Quote:
    # usermod -G power -a <username>
 
Old 06-11-2011, 06:25 AM   #6
firekage
Member
 
Registered: May 2011
Location: Poland
Distribution: Slackware, Ubuntu, Arch
Posts: 275

Rep: Reputation: 7
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)

Last edited by firekage; 06-11-2011 at 07:00 AM.
 
Old 06-11-2011, 12:54 PM   #7
paladin.michael
Member
 
Registered: Jun 2011
Location: Danbury, CT, USA
Distribution: Kubuntu, Slackware, Debian, FreePBX
Posts: 75

Original Poster
Rep: Reputation: 23
Firekage,

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
Quote:
$ cat /etc/fstab
Mine, for example, looks like this:
Quote:
$ cat /etc/fstab
/dev/sda6 swap swap defaults 0 0
/dev/sda5 / reiserfs defaults 1 1
/dev/sda3 /win ntfs-3g fmask=133,dmask=022 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
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.
 
Old 06-11-2011, 01:53 PM   #8
firekage
Member
 
Registered: May 2011
Location: Poland
Distribution: Slackware, Ubuntu, Arch
Posts: 275

Rep: Reputation: 7
Thanks for a help. I'll try mentioned advices, but i don't have usb keyboard, and my motherboard has only one keyboart input.

There is one more thing - could you show me print screen of KDE power management setup? It's the one that You run trough:

K>system settings>power management>profiles of power managements.

Maybe there is something wrong in my case.

Last edited by firekage; 06-11-2011 at 01:56 PM.
 
Old 07-07-2011, 05:06 PM   #9
karl.essinger
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No sound in KDE when started by startx while working fine when started by kdm/gdm arj1singh Ubuntu 2 12-14-2010 11:55 AM
[SOLVED] Slackware 13.1 and KDE on Lenovo with suspend to RAM / swap dimm0k Slackware 10 06-08-2010 04:25 PM
(Solved) Mouse actions totally fails after "fine tuning" Debian Elive. nooby Debian 9 03-23-2010 02:48 PM
KDE battery Monitor and suspend stopped working penguinpages Fedora 1 05-27-2007 12:25 PM
kdm cannot login to KDE, but gdm and xdm work fine?? ming0 Slackware 2 09-01-2004 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration