Meet the Gang 1 2 3 4 5 6 7 8 9 |
There is no guarantee that your questions here will ever be answered. Readers at confidential sites must provide permission to publish. However, you can be published anonymously - just let us know!
TAG Member bios | FAQ | Knowledge base
From pclouds
Answered By Richard Adams, Frank Rodolf, Mike Orr
What I think he is talking about is that with some computers (dell is the only one I know) that are running windowsNT if you hit the power button on the front of the pc they begin to do a software shutdown.
Thats what he is asking how can he set it up so when he hits the power button that the machine notices this and goes into a software shutdown..
[Richard] Well look at it this way, by depressing the power button on the computer you start a shutdown, ok yes i now know what wa meant, what Linux has that no windows software has is "ctrl-alt-del" invokes the defined call in /etc/inittab by default its in short, "shutdown -r now" that one can change to use 'poweroff' 'shutdown' or 'reboot'.
So instead of pressing the power button on the machine itself, hit ctrl-alt-delete, advantage of that is no need to streach to reach the machine as the keyboard is right in front of you.
[Mike] There is also a POWERFAIL signal Linux uses to signal the detection of an imminent power failure. It's meant for emergencies, but maybe you can somehow latch onto that infrastructure. But an option like 'ctrlaltdel' in '/etc/inittab' would be more ideal.
ATX-style computers have a momentary on/off switch that can (somehow) be made to trigger the "shutdown" command -- maybe. I'm not sure how it's done. Look through "man inittab", "man init" and the kernel documentation, and maybe you'll get an idea.
This won't work with older AT-stype cases and motherboards because they have a true 2-position switch. When you turn the switch off, it cuts the power mechanically, and Linux doesn't know about it. Even if Linux did know about it, there's not enough processor cycles left for Linux to do a clean shutdown before it dies.
[Frank] I did some quick lookup... It seems acpid can do this - should be available with your distribution, or otherwise you can easily find it online.
If not, there is also something called "Linux PowerSwitch Driver", which is meant exactly for what you want... You can find it at:
http://deadlock.et.tudelft.nl/~joris/powerswitch
Hope this helps you!
Thanks for all advices. I have got powerswitch. It work very well!
Meet the Gang 1 2 3 4 5 6 7 8 9 |