Ask Your Question
0

Hardware button Shutdown

asked 2012-01-23 14:51:03 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hello All,

I'm attempting to get a certain functionality out of the physical power button on a newly install version 16 machine and am running to into trouble. I simply want the power button when pressed to initiate a shutdown. I've referenced this and this but I can't seem to see a difference between the "interactive" setting and the "shutdown" setting in gsettings. Both just seem to produce the shutdown dialog and the "suppress-logout-restart-shutdown" option does not seem to be present in Fedora's version of Gnome 3. Also per the other recommendations about acpi on the second post; those seem to be for Ubuntu specifically. Can anyone point me in the right direction?

Thanks, -Tim

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2013-06-03 11:13:31 -0500

rahvee gravatar image

updated 2013-06-03 11:14:34 -0500

Evidently, around fedora-16, they started changing how they do power management. By default, acpid is no longer installed, and instead, you have gnome-power-manager and upower (not sure which, if either, of those are new or newly configured differently by default.)

As mentioned elsewhere, you can make the acpi power button trigger an interactive prompt, but only if you're logged into the system at the time.

gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown

If you want, instead, to unconditionally force a graceful immediate shutdown, regardless of being logged in or not (perhaps, like me, because you are using a VM host to gracefully halt a VM guest) you can do this:

Start by installing acpid.

sudo yum -y install acpid

Notice, recent versions (fedora-16 ish and higher) have changed the handling of acpid, and for some reason, at least for me, it doesn't work anymore. So here's what I do:

cd /etc/acpi/actions
sudo cp -p power.sh power.sh.orig
sudo vi power.sh

(or whatever is your favorite editor) Eliminate all lines except these:

#!/bin/sh
PATH=/sbin:/bin:/usr/bin
shutdown -h now

Now, pressing the acpi power button will cause an unconditional immediate graceful shutdown.

edit flag offensive delete link more

Comments

Some additional and updated info: I just did this with my headless plex media server running Fedora 24. The acpi method still works but you must start and enable the acpid after you install it.
systemctl start acpid; systemctl enable acpid

I realize this is likely viewed as common sense to seasoned fedora/linux vets, but it took me a day to figure out why it was not working.

The gsettings method appears to be deprecated. While it is still an available command, the syntax has changed slightly and the only options are: 'nothing' 'suspend' 'hibernate'

Using GNOME Shell 3.20.2

isthistaken gravatar imageisthistaken ( 2016-07-01 17:25:22 -0500 )edit
0

answered 2012-01-24 07:34:46 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi again, i guess i didn't read your question properly, apologies.

Looking at the possible values of button-power,

$ gsettings range org.gnome.settings-daemon.plugins.power button-power
enum
'blank'
'suspend'
'shutdown'
'hibernate'
'interactive'
'nothing'

try something like this:

$ gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown

This has already been answered, please see: http://ask.fedoraproject.org/question/196/how-do-i-get-the-shutdown-menu-by-pressing-the

edit flag offensive delete link more
0

answered 2016-02-01 11:42:11 -0500

fabiand gravatar image

In Fedora 22 zou can use the GNOME Tweak utility to change the hardware button behavior.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-01-23 14:51:03 -0500

Seen: 7,758 times

Last updated: Jun 03 '13