[CentOS] Getting confirmation for power button

2013-04-25 Thread Vanhorn, Mike

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.

Thanks!

---
Mike VanHorn
Senior Computer Systems Administrator
College of Engineering and Computer Science
Wright State University
265 Russ Engineering Center
937-775-5157
michael.vanh...@wright.edu
http://www.cecs.wright.edu/~mvanhorn/




___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread Giles Coochey

On 25/04/2013 14:43, Vanhorn, Mike wrote:

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.



You are talking about something that acpid is doing for you:

http://linux.die.net/man/8/acpid


--
Regards,

Giles Coochey, CCNP, CCNA, CCNAS
NetSecSpec Ltd
+44 (0) 7983 877438
http://www.coochey.net
http://www.netsecspec.co.uk
gi...@coochey.net


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread Vanhorn, Mike
On 4/25/13 9:46 AM, Giles Coochey gi...@coochey.net wrote:

You are talking about something that acpid is doing for you:

http://linux.die.net/man/8/acpid



Yes, I know this is handled by acpid; that's where the
/etc/acpid/events/power.sh 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.

---
Mike VanHorn
Senior Computer Systems Administrator
College of Engineering and Computer Science
Wright State University
265 Russ Engineering Center
937-775-5157
michael.vanh...@wright.edu
http://www.cecs.wright.edu/~mvanhorn/




___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread Giles Coochey

On 25/04/2013 15:00, Vanhorn, Mike wrote:

On 4/25/13 9:46 AM, Giles Coochey gi...@coochey.net wrote:


You are talking about something that acpid is doing for you:

http://linux.die.net/man/8/acpid



Yes, I know this is handled by acpid; that's where the
/etc/acpid/events/power.sh 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.


--
Regards,

Giles Coochey, CCNP, CCNA, CCNAS
NetSecSpec Ltd
+44 (0) 7983 877438
http://www.coochey.net
http://www.netsecspec.co.uk
gi...@coochey.net


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread John Doe
From: Vanhorn, Mike michael.vanh...@wright.edu

 Yes, I know this is handled by acpid; that's where the
 /etc/acpid/events/power.sh 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.

On CentOS 5: /etc/acpi/events/power.conf
  # ACPID config to power down machine if powerbutton is pressed, but only if
  # no gnome-power-manager is running
  ...

On CentOS 6:/etc/acpi/actions/power.sh
  ...
  # Check that there is a power manager, otherwise shut down.
  ...

Do you use gnome?
If so, in 'System / Preferences / ... / Power Managment', in the 'General' tab, 
there is When power button is pressed = Ask me

JD
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread Vanhorn, Mike
On 4/25/13 10:38 AM, John Doe jd...@yahoo.com wrote:

On CentOS 5: /etc/acpi/events/power.conf

Sorry, I meant power.conf in my original post, not power.sh.

Do you use gnome?
If so, in 'System / Preferences / ... / Power Managment', in the
'General' tab,

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.

---
Mike VanHorn
Senior Computer Systems Administrator
College of Engineering and Computer Science
Wright State University
265 Russ Engineering Center
937-775-5157
michael.vanh...@wright.edu
http://www.cecs.wright.edu/~mvanhorn/




___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting confirmation for power button

2013-04-25 Thread John Doe
From: Vanhorn, Mike michael.vanh...@wright.edu

 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.

Maybe try (untested):
  sudo -u gdm gconftool-2 -g /apps/gnome-power-manager/action_button_power
  sudo -u gdm gconftool-2 -s /apps/gnome-power-manager/action_button_power -t 
string interactive
  sudo -u gdm gconftool-2 -g /apps/gnome-power-manager/action_button_power

JD
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos