How to install the powerswitch module on a SME server
Author: Michiel Blotwijk <Michiel.Blotwijk@Altiplano.Be>
Release supported: SME 5.6 and 6.0
License: GPL
Last updated: 9 January, 2004
Most Up-todate version can be found here: http://www.contribs.org/contribs/mblotwijk/HowToGuides/powerswitch.htm

Purpose: The powerswitch driver makes it possible to use the ATX power button on your computer to shutdown Linux. You simply press the power button, and the driver shuts down Linux and powers off the machine, just like the shutdown command does.


Installation:

Download the latest version of the powerswitch from http://www.contribs.org/contribs/mblotwijk/Contribs/powerswitch/.

Install as 'root':

[root@hogwarts /]# rpm -Uvh  e-smith-powerswitch-*.rpm

 

This installs the modules in /usr/lib and a start-up script in /etc/e-smith/events/local. This start-up script will load the correct module, depending on the version of the SME server (5.6 or 6.0).

Test the powerswitch driver: press the suspend button and the system should shut down immediately.


Notes:

This contribution is merely a repackaging of Joris van Rantwijk's powerswitch module. All credits (and litigations ;-) should go to him. His original files are included in /usr/doc/powerswitch-1.5.


Trouble shooting:

These "problems & solutions" come from Joris van Rantwijk's documentation and have been limited to those issues that are relevant to the SME server.

If the module fails to load or doesn't work properly, try the command "dmesg" to see any kernel messages about the module.

P: Loading the module results in a warning about tainting the kernel because there is no license in the module file.
S: This message appears because there is no explicit license statement in the powerswitch module code. I refuse to put a license statement in the module because I don't believe in this automated license checking
business. But don't worry: tainting the kernel is completely harmless, and powerswitch is free software.

P: The system immediately powers off when pushing the power button.
S: The power button is not properly configured as suspend button. Go to the BIOS setup and set the power button action to APM suspend. Some BIOSes have a power management master switch which must be
enabled to make it work.

P: The system doesn't shut down when pushing the power button with the module loaded.
S: Look at the kernel messages. After pushing the button, powerswitch should say "Received suspend event". If this doesn't work, try pushing the button without the module loaded; the system should go to suspend
mode. Make sure you are running a kernel with APM support (the file /proc/apm should exist).

P: My system doesn't suspend when pushing the power button without the module loaded.
S: Try what happens when pushing the power button before Linux starts (like in the bootloader screen). If the suspend button works before starting Linux, but not inside Linux, then you may have a driver loaded
which blocks suspend events (some videocard/soundcard drivers). Also look for "suspend was vetoed" messages from the kernel.