[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Shutdown via power button

I've set up a debian linux server which the user wants to be able to
shut down every day.  It's set up without a keyboard or monitor, any
administration is done by telnet.  I'd like them to be able to shut it
down cleanly by hitting the power button.  The attached message I found
in the archive explains how to do it, and works fine, with the caveat
mentioned in the message.  The system will sometimes suspend before
shutting down, and the user has to push the power button again to wake
it up so it can shut down (if you follow).  Does anyone have a solution
to this?  Either a way to delay or cancel the suspend, or significantly
speed up the shutdown.  Thanks!

| From: "Martin Bialasinski" <martin@internet-treff.uni-koeln.de> 
| Date: 18 Jun 1999 23:53:26 +0200 
| >> "AM" == Alisdair McDiarmid <alisdair@letdown.demon.co.uk> writes:
| AM> I've got an ATX system with APM enabled and working fine. I'd like
| AM> to disable the power button in software so that the machine
| AM> effectively cannot be switched off without root access - `shutdown
| AM> -h now' would still halt and power-down.
| I do something similar. Instead of disabling the button (don't know if
| this is possible), I set it in the BIOS to make the computer go to
| power-safe mode (suspend). (holding it pressed down will still turn
| the computer off).
| Then I installed apmd and make a script /etc/apm/suspend.d/shutdown
| #!/bin/sh
| shutdown -h now
| Now when I press the button, the box will do a clean
| shutdown. SOmetimes the suspend mode is initialized before linux could

| kill everything, then i press the button again, suspend mode will be
| deactivated, and the suspeded shutdown command will finish its job.
| Kind of handy, if your keyboard and mouse is stuck (do to a bug in X
| or 3Dfx or such).

Randy Orrison
Keswick Computer Services

Reply to: