LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   APM: Change Power Button (etc) function? (https://www.linuxquestions.org/questions/slackware-14/apm-change-power-button-etc-function-675780/)

shadowsnipes 10-12-2008 12:16 AM

APM: Change Power Button (etc) function?
 
Is there a way I can change APM's default action executed when the power button is pressed? On my computer it puts it in standby, but I would rather that it shut down instead.

I know ACPI can do this, but the computer concerned is old and APM works more reliably on it.

Thank you in advance for any help.

acummings 10-12-2008 11:56 PM

Hi,

BTW, usually, if it (power sw) set (in bios) to "standby" then, if you were to hold the button depressed for longer than four seconds this is what turns it off.

If you want it off via your power switch, have you tried holding it depressed for, say, 6 or more seconds?

(such behavior usually can be changed in the bios ie "not to standby but [another setting choice] quickly to off" so that it does not have to be held in for longer than 4 seconds to turn the box off).

How the power button behaves is in the bios.

Or, usually, there are settings/behavior changes for the power button in the bios.

Must be an ATX (soft power off capability) motherboard. (Not the old old [circa near 1996] AT which had mechanical switch on/off).

--
Alan.

shadowsnipes 10-13-2008 01:21 AM

Quote:

Originally Posted by acummings (Post 3308298)
Hi,

BTW, usually, if it (power sw) set (in bios) to "standby" then, if you were to hold the button depressed for longer than four seconds this is what turns it off.

If you want it off via your power switch, have you tried holding it depressed for, say, 6 or more seconds?

(such behavior usually can be changed in the bios ie "not to standby but [another setting choice] quickly to off" so that it does not have to be held in for longer than 4 seconds to turn the box off).

How the power button behaves is in the bios.

Or, usually, there are settings/behavior changes for the power button in the bios.

Must be an ATX (soft power off capability) motherboard. (Not the old old [circa near 1996] AT which had mechanical switch on/off).

--
Alan.

Thanks for the response. Yeah it's an ATX mainboard, but the BIOS does not have any options for changing the power button's function (Sorry, I should have mentioned this previously). And while holding the power button does turn off the computer (as everyone who has ever had a computer freeze on them knows), it does not shut it down nicely.

Any other ideas? I figure APM can't do what I am looking for without hacking the source code, but maybe it can. Are there any other tools/ways to accomplish what I am looking for (a soft shutdown activated by the power button)?

acummings 10-13-2008 01:51 AM

Unaware of any other to do what you want.

Quote:

And while holding the power button does turn off the computer (as everyone who has ever had a computer freeze on them knows), it does not shut it down nicely.
I was unaware that acpi could (shut it down nicely).

Also unaware that O.S. feature could get control over power button behavior.

Likely then has similarity to irq assignments whereby "if not plug and play O.S." (irq's are assigned by bios -- but "if yes, it is a plug and play O.S." (irq's are assigned by the O.S.)

BTW you hadn't specified whether or not as to nice shutdown.

I did not used to know the distinction between why one quick punch of power button would (not nicely) turn off some computers while on others it would put them into standby whereby the "standby equipped" boxes required a 4 plus seconds depress to (not nicely) turn off (quick/immediate off the moment the button is depressed versus 4 plus seconds depressed so as to achieve off).

But those boxes were circa 1999 (Intel BX chipset motherboards) (APM) and they also (I later discovered) did have the power button behavior optiions in the bios. And the settings did work because I changed a couple so that I could standby them via the power button then wake them later on.

forum1793 10-13-2008 11:00 AM

Quote:

I was unaware that acpi could (shut it down nicely).
It does on my gigabyte (780g) board. I just touch the power button once and it appears to execute a HALT command. This is much better than holding it for four seconds because, at a minimum, it does not check the hd upon next boot.

I do not remember what I allowed in bios but don't think I did anything special. I did compile newer kernel and am using acpi. Have not tried anything with apm.

shadowsnipes 10-13-2008 11:02 PM

Quote:

Originally Posted by forum1793 (Post 3308783)
It does on my gigabyte (780g) board. I just touch the power button once and it appears to execute a HALT command. This is much better than holding it for four seconds because, at a minimum, it does not check the hd upon next boot.

I do not remember what I allowed in bios but don't think I did anything special. I did compile newer kernel and am using acpi. Have not tried anything with apm.

Yea, with ACPI you can make the machine do whatever you want when a power button event (or any power event) is detected. Unfortunately ACPI's standby borks this system in Linux. It a main board from 2000, and like my 1999 laptop APM seems to behave better- it just has less flexibility.


@acummings,

you made a good suggestion about Plug n play. I had recently turned it off to make my Nvidia driver work properly with APM. I'll play around with it.

As a side note, I have Windows XP installed on this machine as well and it uses ACPI. When I press the power button in XP is shuts down cleanly.


All times are GMT -5. The time now is 07:24 AM.