LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Computer power button not functioning until you login. (https://www.linuxquestions.org/questions/linux-newbie-8/computer-power-button-not-functioning-until-you-login-665075/)

E71 08-24-2008 03:09 PM

Computer power button not functioning until you login.
 
Hi all,

Is there any way I can get Fedora 8 to respond to my computer's power button being pressed even when no-one has logged in?

It only appears to work after you log in...

Thanks,
E71

bapigoo9 08-25-2008 12:12 PM

An alternative is to use the Shutdown option at the login screen. I have used Fedora 9, and I would use the Shutdown option...next time I can try to power down with the button...keep in mind that Linux likes to shutdown nicely, so that it can do all of its clean-up. You should use the Shutdown command. Any reason not to upgrade to Fedora 9?

If you power-down without letting Linux shutdown nicely, you may lose some data or have to give Linux the chance to clean-up on reboot.

Is that problem universal for Fedora 8?

E71 08-25-2008 03:20 PM

Quote:

Originally Posted by bapigoo9 (Post 3259182)
An alternative is to use the Shutdown option at the login screen. I have used Fedora 9, and I would use the Shutdown option...next time I can try to power down with the button...keep in mind that Linux likes to shutdown nicely, so that it can do all of its clean-up. You should use the Shutdown command. Any reason not to upgrade to Fedora 9?

If you power-down without letting Linux shutdown nicely, you may lose some data or have to give Linux the chance to clean-up on reboot.

Is that problem universal for Fedora 8?

Thanks for the reply, however to clarify my situation:

My FC8 box has no keyboard/mouse/screen connected and is controlled purely via SSH over the network. To shutdown, I normally issue the shutdown -h now command.

Normally, when I switch it on, it always remains on the login screen but I'd like for it to shutdown as normal (clean shutdown) by pressing (without holding) the power button (just like how you would in Windows or Linux after logging in).

Any suggestions?

Thanks,
E71

bapigoo9 08-25-2008 05:35 PM

E71, I think that I get your question after you explained it a bit more. There is something called Power Management, and while I can not point to the specific place in FC8 to find it (since I am not using the FC9 that I have right now...) you would need to change the settings so that it would allow you to power down ("shutdown") nicely from the login screen. If you look for it, you should find it. Someone else who has FC8 or 9 handy should be able to give the exact answer to your question.

Another option that I would like, that is better than just attaching a keyboard to it and to know what to do to get it to shutdown, is to make it into a touch-screen system. Then you just touch the shutdown option, and you are done. Too fancy for you?

E71 08-25-2008 06:21 PM

Hehe. Not too fancy, just too expensive. Still, thanks for the suggestions, I'll check it out.

harryhaller 08-25-2008 11:27 PM

Have a look at the file /etc/acpi/acpi_handler.sh

That's its location on Slackware - on RH it may have a different location.

You will need something like the following in it:

Code:


#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
        ;;
      *) logger "ACPI action $2 is not defined"
        ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac

The line in red is the crucial line. You might like to change it to one of the shutdown commands or poweroff.

If you want it to do something more complex, then have it call your own script in that line and put the commands you want it to execute in that script.

Place your script in the same directory as that of acpi_handler.sh.

E71 08-26-2008 02:48 PM

Thanks for the suggestion. I'm having some trouble finding the Redhat counterpart but I'm sure it's there somewhere. Thanks again.

bapigoo9 01-11-2009 05:51 PM

Did you find the counterpart in RH? Post your solution if it works now.

E71 01-11-2009 05:57 PM

I'm afraid I couldn't find it.

It would be nice to know how because it would make my fileserver/nas a little more like an appliance.

bapigoo9 01-11-2009 06:02 PM

This is not a direct answer to your question, but should help you get started in the right direction.

E71 01-12-2009 05:45 AM

Thank you. I'll check it out.


All times are GMT -5. The time now is 03:55 PM.