View previous topic :: View next topic |
Author |
Message |
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Thu Sep 25, 2003 8:19 am Post subject: acpi poweroff |
|
|
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 |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
Posted: Thu Sep 25, 2003 5:32 pm Post subject: |
|
|
what kernel are you using? |
|
Back to top |
|
|
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Thu Sep 25, 2003 5:54 pm Post subject: |
|
|
Currently, ck-sources 2.4.22-r2, but previously vanilla 2.4.22. |
|
Back to top |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
|
Back to top |
|
|
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Thu Sep 25, 2003 8:27 pm Post subject: |
|
|
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 |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
Posted: Thu Sep 25, 2003 8:38 pm Post subject: |
|
|
which acpi options did you use in the kernel?
I assume you DIDNT select the ht only one? |
|
Back to top |
|
|
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Thu Sep 25, 2003 8:49 pm Post subject: |
|
|
You're correct in your assumption, I have ACPI support, button, and processor. |
|
Back to top |
|
|
TheCoop Veteran
Joined: 15 Jun 2002 Posts: 1814 Location: Where you least expect it
|
Posted: Thu Sep 25, 2003 9:07 pm Post subject: |
|
|
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 |
|
|
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Thu Sep 25, 2003 10:58 pm Post subject: |
|
|
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 |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
Posted: Fri Sep 26, 2003 12:48 am Post subject: |
|
|
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 |
|
|
Xero n00b
Joined: 12 Sep 2003 Posts: 17
|
Posted: Fri Sep 26, 2003 2:41 am Post subject: |
|
|
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 |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
Posted: Fri Sep 26, 2003 3:05 am Post subject: |
|
|
thanks, I just switched to r2 and all is working good |
|
Back to top |
|
|
jonas_nilsson n00b
Joined: 21 Aug 2003 Posts: 57 Location: Stockholm, Switzerland
|
Posted: Tue Dec 23, 2003 10:20 pm Post subject: |
|
|
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 |
|
|
rafo Apprentice
Joined: 18 Nov 2003 Posts: 161 Location: Sollentuna, Sweden
|
Posted: Wed Dec 31, 2003 3:03 pm Post subject: |
|
|
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 |
|
|
|