LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-14-2005, 05:08 AM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Rep: Reputation: 47
apm and console suspend


A nice feature of my laptop is that in the BIOS I have a power down feature called suspend. After 5 minutes of inactivity in the console, my pc powers down and the cooling fans turn off till a key is pressed to wake it up. This worked fine in Slack 10, kernel 2.4.31, with the following line uncommented in /etc/rc.d/rc.modules:

/sbin/modprobe apm

I recently wiped my drive, did a fresh install of Slack 10.1 and upgraded the kernel to 2.4.31. APM is enabled in rc.modules but it doesn't go into suspend mode anymore. BIOS settings did not change.

Any idea what the difference could be?

These are installed:
acpid-1.0.4-i486-2

In the running processes:

apmd is running
acpid is NOT running

My laptop is 6+ years old and needs apm....not sure if acpi should be running at the same time as apm..

Last edited by linuxhippy; 06-14-2005 at 05:34 AM.
 
Old 06-15-2005, 03:09 AM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Try both the following commands:
apm -S
apm -s
Which one worked?
 
Old 06-15-2005, 08:10 AM   #3
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
apm -s worked right away. I didn't know there was a man page for apm...learn something new every day!!
 
Old 06-15-2005, 12:22 PM   #4
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
any idea how to background apm -s so that it goes into suspend when I log out?
 
Old 06-15-2005, 12:49 PM   #5
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Just add it to ~/.bash_logout. This will not background it, but execute it immediately when you log out.
To delay, add the 'at' command.
 
Old 06-16-2005, 09:01 PM   #6
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
I put apm -s in my user .bash_logout and got a permissions error about apm when I logged out. As root I tried to chown and chgrp for /proc/apm and I tried chmod 0666 for /proc/apm and chmod a+x /proc/apm and none of that worked.

How can I change permissions for apm?
 
Old 06-16-2005, 10:48 PM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
You could configure sudo to allow sudo apm -s from your user.
 
Old 06-17-2005, 04:15 AM   #8
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
sudo is the best (have a look at man visudo sudoers sudo).
The other solution is to set the setuid bit (chmod u+s /usr/bin/apm).
 
Old 06-19-2005, 12:06 AM   #9
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
I tried chmod u+s /usr/bin/apm. When a user types apm -s, he gets:

Cannot open APM device: Permission denied

sudo apm -s works well but always prompts for a password. Can I indicate that a password is not needed?
 
Old 06-19-2005, 02:22 AM   #10
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
edit /etc/sudoers
I use these values as example :
username : linuxhippy
hostname : darkstar
Code:
linuxhippy  darkstar = NOPASSWD: /usr/bin/apm -s
So after that you run the command as :
sudo /usr/bin/apm -s
(note that you will have to give the full path)
 
Old 06-19-2005, 12:58 PM   #11
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
That worked well-thanx!
 
Old 07-03-2005, 07:45 PM   #12
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
Quote:
Originally posted by uselpa
Just add it to ~/.bash_logout. This will not background it, but execute it immediately when you log out.
To delay, add the 'at' command.
Would you please go into detail about delaying apm -s...I want to delay it 5 minutes.
 
Old 07-03-2005, 11:12 PM   #13
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
this is why I want to know more about sudo ;DD

for those who wandering about using sudo...
 
Old 07-04-2005, 01:46 PM   #14
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Quote:
Originally posted by linuxhippy
Would you please go into detail about delaying apm -s...I want to delay it 5 minutes.
When I suggested that, I was thinking about delaying for a few seconds, just in order to allow your session to close properly. You could have added a simple
Code:
 sleep 5 && sudo apm -s
or an at command.

Of course, you could add
Code:
 echo 'sudo apm -s' | at now + 5 minutes
to .bash_logout. However, this is unconditional and even if you login again, you'll get suspended. Probably not what you want - if you login before 5 minutes, you'd have to cancel the at command via an "atrm".

I guess that in that case you'll have to configure your BIOS to send the apmd a signal after 5 min. Look into your BIOS options if you have a way of configuring this, and try if it works.
 
  


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
cron job and apm suspend linuxhippy Slackware 7 01-20-2007 06:43 AM
no consoles after resume from apm suspend tjfitz Linux - General 0 12-21-2004 09:07 AM
apm suspend-to-disk m00t00 Linux - Laptop and Netbook 0 11-24-2004 03:21 PM
Apm suspend kills alsa driver orjanp Slackware 3 10-28-2003 07:24 AM
apm --suspend changes clock time. unholy Linux - Laptop and Netbook 3 10-09-2003 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:32 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