Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
acpi poweroff
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Thu Sep 25, 2003 8:19 am    Post subject: acpi poweroff Reply with quote

I've messed with trying to get acpi to shut the power off in the past and my results were inconsistant. With my old computer, it'd shut off about 1/3 of the time, I ended up just using apm=power-off in lilo to make things work and said bye bye to ACPI. On my new computer I need ACPI for hyperthreading so I figured I'd try to get it working again.

Using poweroff, halt -p, or any of the power down commands, while they shut down linux, they don't power off the computer. I have acpid installed and it shuts everything down when I press the power button, but again, no power off. I did a little research, searched these forums, and decided to try echo -n 5 > /proc/acpi/sleep. Sure enough, it works, my computer powers down. I then added that to /etc/init.d/shutdown.sh and now everything appears to be working perfectly. Everything gets shut down and then the computer powers off.

Is it safe to add echo -n 5 > /proc/acpi/sleep to the bottom of shutdown.sh? And why isn't it powering off using acpi without this? It's quite obvious to me that acpi is indeed working. I'm offically convinced that the halt or shutdown commands are not doing something right, or I'm expecting them to do something they don't even do, which seems odd as it used to work somewhat with my old computer, and it works fine with apm.

Any clues?
Back to top
View user's profile Send private message
Moled
l33t
l33t


Joined: 09 Jul 2003
Posts: 635

PostPosted: Thu Sep 25, 2003 5:32 pm    Post subject: Reply with quote

what kernel are you using?
Back to top
View user's profile Send private message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Thu Sep 25, 2003 5:54 pm    Post subject: Reply with quote

Currently, ck-sources 2.4.22-r2, but previously vanilla 2.4.22.
Back to top
View user's profile Send private message
Moled
l33t
l33t


Joined: 09 Jul 2003
Posts: 635

PostPosted: Thu Sep 25, 2003 6:07 pm    Post subject: Reply with quote

http://www.kernel.org/pub/linux/kernel/v2.4/testing/patch-2.4.23.log

its in there near the bottom somewhere, I assume you have a p4?

acpi works quite nicely now
!

emerge vanilla-prepatch-sources

shutdown -h works fine now on my p4 :)
Back to top
View user's profile Send private message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Thu Sep 25, 2003 8:27 pm    Post subject: Reply with quote

I just tried the prepatch kernel and the situation is the same. It still doesn't work unless I add that line to shutdown.sh, and then it started behaving like it did on my old computer, it'd shut down half of the time or so. 2.4.22 didn't do that. No matter what I do it seems without adding that line to shutdown.sh it doesn't power off at all. The only thing I can think of is maybe baselayout needs to be recompiled so halt/shutdown/etc knows about acpi. I see nothing about them that mentions ACPI anywhere though, so I don't think it would make a difference.
Back to top
View user's profile Send private message
Moled
l33t
l33t


Joined: 09 Jul 2003
Posts: 635

PostPosted: Thu Sep 25, 2003 8:38 pm    Post subject: Reply with quote

which acpi options did you use in the kernel?

I assume you DIDNT select the ht only one?
Back to top
View user's profile Send private message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Thu Sep 25, 2003 8:49 pm    Post subject: Reply with quote

You're correct in your assumption, I have ACPI support, button, and processor.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Thu Sep 25, 2003 9:07 pm    Post subject: Reply with quote

have you tried acpid? adding it to startup, and pressing power button shuts the computer down. ymmv however
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Thu Sep 25, 2003 10:58 pm    Post subject: Reply with quote

I already have acpid installed and added to startup. It does shut down using the power button, that works without a flaw. It still doesn't power off the computer though, unless I add that line to shutdown.sh
Back to top
View user's profile Send private message
Moled
l33t
l33t


Joined: 09 Jul 2003
Posts: 635

PostPosted: Fri Sep 26, 2003 12:48 am    Post subject: Reply with quote

From man acpid:

Quote:
EXAMPLE
This example - placed in /etc/acpi/events/power - will shut down your system if you press the power button.

event=button power.*
action=/usr/local/sbin/power.sh "%e"

The script power.sh gets called and will see the complete event string as parameter $1.


so pressing the power button would run /usr/local/sbin/power.sh
(or shutdown -h now in my case)


so I press my power button:

/var/log/acpid
Quote:
[Fri Sep 26 01:44:00 2003] received event "button/power PWRF 00000080 0000000d"
[Fri Sep 26 01:44:00 2003] executing action "/etc/acpi/default.sh button/power PWRF 00000080 0000000d"
[Fri Sep 26 01:44:00 2003] BEGIN HANDLER MESSAGES
[Fri Sep 26 01:44:00 2003] END HANDLER MESSAGES
[Fri Sep 26 01:44:00 2003] action exited with status 0
[Fri Sep 26 01:44:00 2003] completed event "button/power PWRF 00000080 0000000d"


but it doesn't do anything
:(
Back to top
View user's profile Send private message
Xero
n00b
n00b


Joined: 12 Sep 2003
Posts: 17

PostPosted: Fri Sep 26, 2003 2:41 am    Post subject: Reply with quote

As that log shows it's running /etc/acpi/default.sh. Are you using ~x86? It seems that the current stable x86 has a bug with default.sh. Try using acpid-1.0.2-r2, if you're not already.
Back to top
View user's profile Send private message
Moled
l33t
l33t


Joined: 09 Jul 2003
Posts: 635

PostPosted: Fri Sep 26, 2003 3:05 am    Post subject: Reply with quote

thanks, I just switched to r2 and all is working good
Back to top
View user's profile Send private message
jonas_nilsson
n00b
n00b


Joined: 21 Aug 2003
Posts: 57
Location: Stockholm, Switzerland

PostPosted: Tue Dec 23, 2003 10:20 pm    Post subject: Reply with quote

Hrmm, I've noticed this thread hasn't been active since early stone age, but I will post anyway.

Quote:
As that log shows it's running /etc/acpi/default.sh. Are you using ~x86? It seems that the current stable x86 has a bug with default.sh. Try using acpid-1.0.2-r2, if you're not already.


I am currently at my parents place for Christmas celebration, and only have a half-dead modem line, so all my sympathies go to those who can't download any fresh ebuilds.

The essence of this post is:
The style of the event expressions have changed in the kernel, so the line in the posted example saying
Code:
event=button power.*

should now be
Code:
event=button/power.* 


So you don't have to update acpid!
Merry Christmas to all of you!
_________________
Physics is like sex: sure, it may give some practical results, but that's not why we do it.
--Richard Feynman
Back to top
View user's profile Send private message
rafo
Apprentice
Apprentice


Joined: 18 Nov 2003
Posts: 161
Location: Sollentuna, Sweden

PostPosted: Wed Dec 31, 2003 3:03 pm    Post subject: Reply with quote

I also have had the problem where `shutdown -h now' doesn't physically power down the machine. On a oldish Dell 166 MHz desktop I could solve this by adding APM support to the kernel, including the "use real mode APM BIOS to power off" feature.

However, this didn't work on my slightly less old Compaq Deskpro (PIII 700 MHz). After several attempts with APM or ACPI in the kernel I found that I also had to add a parameter "acpi=force" on the kernel invocation line in GRUB. According to the messages obtained before including that parameter the Linux kernel doesn't by default trust a BIOS from the 1990's to have usable ACPI.

Upgrading the BIOS was not an option for this particular machine (system ROM family 686T3), even the most recent upgrade is dated 1999.

Once the "acpi=force" parameter was added the acpid service could be activated. However, `shutdown -h now' causes a physical power down even without having acpid running. The ACPI features that I have enabled in the kernel are "button" and "processor".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum