Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a headless linux mint machine that I use for a file server and other things. It's been working great for me for a few years, but there's one issue - my cat likes to hang out on top of it, and when she climbs off and on she occasionally steps on the power button and shuts off the machine.

Is there an easy way to change the behavior of the power button so it requires an extremely long duration press (10 seconds or so) or multiple presses in order to do anything?

share|improve this question
    
Is this a desktop or a laptop? I'm guessing laptop if that cat has access to the power button. –  terdon Jan 10 at 17:45
    
It's a desktop - is this actually relevant to a software solution? –  schizodactyl Jan 10 at 22:16

2 Answers 2

up vote 0 down vote accepted

Well, one thing you could do is simply disable the power button altogether. Personally, I only use it to turn on my machine, and never use it once the machine is on. If this is an OK solution for you, edit /etc/acpi/events/powerbtn-acpi-support:

sudo nano /etc/acpi/events/powerbtn-acpi-support

That file should look something like this:

event=button[ /]power
action=/etc/acpi/powerbtn-acpi-support.sh

To make the power button do nothing, change it to:

event=button[ /]power
action=

Then restart the acpi daemon with

sudo service acpid restart

Your power button should no be ignored.

share|improve this answer
    
I'm not really comfortable disabling the button entirely as, since it's a headless machine, if sshd were to crash or something along those lines my only recourse would be to cut off power to the machine. I'd much rather still leave myself with the ability to shut down gracefully if possible. –  schizodactyl Jan 10 at 22:20
    
@schizodactyl on my laptop, the solution above disables only the single press of the power button. A long press will still shut the machine down (though not very gracefully). I don't have access to a desktop at the moment so I can't test how it would work but, presumably, it will do the same. You can also map a shortcut to the shutdown command if you have a keyboard attached. –  terdon Jan 11 at 2:28

Duct-tape a cardboard guard over the button. Take three pieces of corrugated cardboard, and cut a hole in each large enough for your finger to reach through to the button. Glue them together, with the hole aligned, then duct tape the assembly around the button. All hail our feline overlords!

share|improve this answer
    
See: Molly-guard –  jwygralak67 Jan 10 at 22:00
    
As this is legitimately what I was considering doing if there's no good software solution, I can't really fault you for suggesting it... –  schizodactyl Jan 10 at 22:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.