Getting Confirmation For Power Button

Home » CentOS » Getting Confirmation For Power Button
CentOS 6 Comments

Using CentOS 5.8:

Currently on my workstations, when I press the power button the computer immediately does a ‘shutdown -h now’ (per /etc/acpid/events/power.conf). Is there a way to change it so that a confirmation dialog comes up, rather than an immediate shutdown?

I assume that I am going to need to change that power.conf file to tell some program that the power button’s been pressed, rather than making a call to shutdown, but I haven’t been able to figure out what program to which I need to make a call.


6 thoughts on - Getting Confirmation For Power Button

  • Yes, I know this is handled by acpid; that’s where the
    /etc/acpid/events/ file comes in. I’m asking if anyone knows what changes to make to that file so that it gives a prompt first.

    I’m guessing that there is a program out there already that will prompt for a shutdown, I just don’t know what that program is.

  • It kind of depends what environment you are using and how you can hook into the standard power-off program that runs when you shutdown in the GUI. You would edit the actions to run that program.

  • Sorry, I meant “power.conf” in my original post, not “”.

    Yes, and that works fine, *if* the user is logged in. But what about when the workstation is sitting there at the login window? At that point, when the action from power.conf is taken, there is no power manager, so it does the shutdown.

    I’m wanting to get a prompt in that situation, too.