Koozali.org: home of the SME Server

How do I reconfigure the power button?

Offline Beddhist

  • 14
  • +0/-0
How do I reconfigure the power button?
« on: July 27, 2008, 11:35:36 AM »
I've spent a few hours searching here, Centos and Redhat, but can't find an answer to what I think must be a common problem: when I press the power button on our server it goes into suspend mode. Not very useful on a server. Since it has no keyboard and screen, how do I change it so it shuts down cleanly instead?

Another question, possibly related: where are the db commands documented?

Thanks for any pointers.

Offline byte

  • *
  • 2,183
  • +2/-0
Re: How do I reconfigure the power button?
« Reply #1 on: July 27, 2008, 01:18:47 PM »
I've spent a few hours searching here, Centos and Redhat, but can't find an answer to what I think must be a common problem: when I press the power button on our server it goes into suspend mode. Not very useful on a server. Since it has no keyboard and screen, how do I change it so it shuts down cleanly instead?

That's more of a BIOS setting, checking your power settings in the BIOS and you'll see a switch there to change.

Moving this topic to the General Discussion forum, it is more appropriate there. Thanks!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #2 on: July 27, 2008, 02:39:57 PM »
Beddhist

Quote
where are the db commands documented?

See the FAQ and the HOWTO links at top of this forum
Please learn to look before asking.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Trashman

  • *
  • 54
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #3 on: September 07, 2008, 04:38:37 AM »
Im not sure if this is what you want, in allmost any notebook pressing and releasing the button fast leads to suspend, but if you keep pressing it for 7-10 seconds the system plain shut down...but its not a "clean" shutdown...and you dont have a lap ofc...

Offline Beddhist

  • 14
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #4 on: September 07, 2008, 04:43:35 AM »
Thanks, but the short press is a Windows function. The long press is a hardware power off (= crash), not a shutdown.

I don't know why my question has been moved here. It's an OS function, related to ACPI and another service running on Linux, but I can't find any human-readable documentation on it. (Yes, I searched...).

Offline pfloor

  • ****
  • 889
  • +1/-0
Re: How do I reconfigure the power button?
« Reply #5 on: September 07, 2008, 07:06:47 AM »
As byte stated, it is most likely a bios setting in your server.

Short (1 second) press of the power button should cleanly shut down your server, this is the default behavior of SME.  If it doesn't behave that way then you need to look at your bios settings.  Try looking under "Power Management" and change the "Power button pressed less than 4 seconds" to something other than "suspend".

I have setup dozens of SME and CentOS servers and they ALL shut down cleanly when I press the power button and I have never had to change anything in the OS but have had to adjust the bios on a few of them.

Thus, your post was moved to general discussion because the OS does what you want, it's your motherboard that is doing what you don't want.
In life, you must either "Push, Pull or Get out of the way!"

Offline Beddhist

  • 14
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #6 on: September 07, 2008, 07:13:00 AM »
Thank you for the clarification. The BIOS was, in fact, the first place where I looked before I even started looking at the OS. As far as I remember the only settings possible are "soft off" or "power off".

I guess you are probably right then, the m/b is blocking me from doing what I want.

Kind regards,
Peter.

Offline pfloor

  • ****
  • 889
  • +1/-0
Re: How do I reconfigure the power button?
« Reply #7 on: September 07, 2008, 07:18:47 AM »
As far as I remember the only settings possible are "soft off" or "power off".

Go in there and change it around.  Those bios "wordings" are generally translated from Chinese to English and don't always translate correctly and sometimes the MB doesn't really do what you think the bios setting mean.

Fiddle with it, I have always been able to make it work properly and I don't see any reason why you shouldn't be able to.

Good luck.
In life, you must either "Push, Pull or Get out of the way!"

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: How do I reconfigure the power button?
« Reply #8 on: September 11, 2008, 05:44:22 AM »
But why use the power button for closing down the server ?

I think I use to do it from console or ssh shell like this: shutdown -h now
Or for a reeboot: shutdown -r now

For something else: man shutdown

There is the shutdown/reboot function at ser server-manager panel as well.
......

Offline Beddhist

  • 14
  • +0/-0
Solved: How do I reconfigure the power button?
« Reply #9 on: September 11, 2008, 06:29:58 AM »
Because the server is in a school of Burmese refugees in Thailand. Nobody knows anything much about computers here, so I try to make things as simple as possible. The office lady just used to hold down the button until it powered off...

There is no screen or keyboard on the server.

Right now I have taught them the server manager way of shutting down, but it's cumbersome having to log on to a PC, start a browser, etc.

"Shutdown now" actually goes into single-user mode. You need to use "poweroff".

Thanks to all the hints above I've re-visited the BIOS setup. I was right about the power button config, but I had turned ACPI off in the BIOS. Turning it on fixed it. (I'm sure I've tried that before and it didn't work, but maybe my memory just fails me.)

Offline pfloor

  • ****
  • 889
  • +1/-0
Re: How do I reconfigure the power button?
« Reply #10 on: September 11, 2008, 06:34:31 AM »
But why use the power button for closing down the server ?

I think I use to do it from console or ssh shell like this: shutdown -h now
Or for a reeboot: shutdown -r now

The preferred SME methods are:

signal-event halt
Or
signal-event reboot

Quote
There is the shutdown/reboot function at ser server-manager panel as well.
There is but someday when you find yourself in the server room in front of the server with the server running headless (no monitor or keyboard) and you need to shut the server down ASAP, you will soon find out how handy it is to just push the power button instead of running up 2 flights of stairs to your office desktop.
In life, you must either "Push, Pull or Get out of the way!"

Offline pfloor

  • ****
  • 889
  • +1/-0
Re: Solved: How do I reconfigure the power button?
« Reply #11 on: September 11, 2008, 06:36:10 AM »
Thanks to all the hints above I've re-visited the BIOS setup. I was right about the power button config, but I had turned ACPI off in the BIOS. Turning it on fixed it. (I'm sure I've tried that before and it didn't work, but maybe my memory just fails me.)

Glad to hear you sorted it all out, I knew you could!
« Last Edit: September 11, 2008, 06:47:11 AM by pfloor »
In life, you must either "Push, Pull or Get out of the way!"

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: How do I reconfigure the power button?
« Reply #12 on: September 11, 2008, 02:13:15 PM »
Some small details to clarify ..

I have been using "shutdown -h now" for allmost 100 % of all shutdowns of e-smith and later sme server for ca 8 years. Until now I have not noticed any errors or any problems, so I thought "signal-event halt" and "shutdown -h now" actually were equivalent functions. They are not ?

One other more important detail to clarify - For all those years I thought that pushing the power off button could damage something, so I have allmost never done that. This might be an incorrect understanding - to push the power off button will also make a nice and good enough power off, like doing the "signal-event halt" ?

(I'm just courious because I think it could be like that, and then it will be good to know it for sure. If there should be any advantages doing the "signal-event halt", over the "shutdown -h now" or to push the power button, this should also be nice to know.)
« Last Edit: September 11, 2008, 02:16:42 PM by arne »
......

Offline Trashman

  • *
  • 54
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #13 on: September 11, 2008, 09:52:04 PM »
A hard off is never good for any modern OS, i guess that he wanted to set it up in the wxp way (press power button = start a soft shutdown)...about halt vs shutdown i have no idea...

Offline MSmith

  • *
  • 675
  • +0/-0
Re: How do I reconfigure the power button?
« Reply #14 on: September 12, 2008, 03:12:32 PM »
Very timely, this, as I just upgraded a server from 6.01 to 7.3 with all updates and changed the BIOS of this older machine to use ACPI in order to get the powerswitch to work "correctly", i.e. a press & release initiates shutdown.  The last command displayed by the shutdown procedure is "acpi_poweroff", then this particular machine shuts down cleanly.  Nice!
...