mate-power-manager power button settings ignored

Bug #1010608 reported by Paddy Launch
130
This bug affects 26 people
Affects Status Importance Assigned to Milestone
Linux Mint
Confirmed
Undecided
Unassigned

Bug Description

Release: 13 (maya)
Edition: MATE 64-bit

Hardware: Dell Latitude D830 laptop

Steps to reproduce:

1. Power Management Prefs: General -> Actions -> When the power button is pressed: SUSPEND
2. Close mate-power-manager
3. Press Power button.

Expected result: Machine suspends

Actual result: Machine shuts down.

Even when the power button action is set to "Ask me", it still shuts down. On one occasion, a list of options came up, but the machine shutdown before there was an opportunity to select any of them.

Additionally apport-bug told me that 'mate-power-manager' is not an official Linux Mint package. And also, mate-power-manager does not appear to be accessible from Control Centre (only from the power management icon in the panel).

Revision history for this message
Jay Carlson (jaycsoftdove) wrote :

I have this problem as well -- I don't know if one of the following "non-standard" installation parts made this bug happen for me but just in case: I'm running a fresh Mint 13 Mate 64-bit installed from DVD image, but my previous home partition (from Mint 11) was left intact for the new system. I also used MintBackup to save my packages list from Mint 11 and re-install the corresponding packages after the upgrade. Also I am running compiz.

Revision history for this message
martywd (martywd) wrote :

Release: 13 (maya) [Fresh 32-bit install, not an update/upgrade]
Edition: MATE 32-bit
Hardware: Samsung NC-10 netbook

 I'm having a similar issue as Reported by Paddy Launch. Instead of setting 'Suspend', I'm using 'Ask me'.

Specifically:
Power Management Preferences | General (tab) | Actions | 'When power button is pushed:' --- Setting is set to 'Ask me'.

Every time, pushing the power button causes the machine to immediately shutdown.

-Computer-
Processor : 2x Intel(R) Atom(TM) CPU N270 @ 1.60GHz
Memory : 2051MB (619MB used)
Operating System : Linux Mint 13 Maya
User Name : marty ()
Date/Time : Fri 15 Jun 2012 11:27:14 PM CDT
-Display-
Resolution : 1024x600 pixels
OpenGL Renderer : Mesa DRI Intel(R) 945GME x86/MMX/SSE2
X11 Vendor : The X.Org Foundation
-Multimedia-
Audio Adapter : HDA-Intel - HDA Intel
-Input Devices-
 Lid Switch
 Power Button
 Sleep Button
 Power Button
 AT Translated Set 2 keyboard
 Video Bus
 HDA Intel Mic
 Namuga 1.3M Webcam
 HDA Intel Headphone
 SynPS/2 Synaptics TouchPad
-Printers (CUPS)-
 <snip>
-SCSI Disks-
ATA ST95005620AS

Revision history for this message
Jan Kalmar (mr-pytagoras) wrote :

I have Linux Mint 13 fresh install to clean disk and I'm also suffering from this bug the same way as was described before.

Revision history for this message
Hans-Christoph Steiner (eighthave) wrote :

I found the issue, it is in the script /etc/acpi/powerbtn.sh. The script looks to see if there is some kind of daemon running that will handle the power button event. If not, it just calls "shutdown -h now" directly. I fixed this by adding one line to the /etc/acpi/powerbtn.sh script (PMS="$PMS mate-settings-daemon"):

[ -r /usr/share/acpi-support/power-funcs ] && getXconsole
PMS="gnome-settings-daemon kpowersave xfce4-power-manager"
PMS="$PMS guidance-power-manager.py dalston-power-applet"
PMS="$PMS mate-settings-daemon"

Revision history for this message
Simon741 (simon-okko) wrote :

Works for me. Thanks Hans-Christoph.

Revision history for this message
SamiR (sami-m-rantala) wrote :

Hans-Christoph's solution works for me, too. Thanks!

Simon741 (simon-okko)
Changed in linuxmint:
status: New → In Progress
Revision history for this message
isaac (isaacgallegos) wrote :

This bug is also in the 32bit edition of LinuxMint 13 Mate

Revision history for this message
Craig Hatch (h958081) wrote :

Hans-Christoph's fix works for me on a Lenovo T500. with the 64bit edition

Revision history for this message
Jay Carlson (jaycsoftdove) wrote :

Brilliant! Thanks to Hans-Cristoph

Revision history for this message
Luis A. Serrano (lserrano-cortez) wrote :

I love you so much for this solution xD
I spent a lot of hours finding possible answers ..

Working on Linux Mint 13 Mate x64; my laptop is a Lenovo G475.

Revision history for this message
Paddy Launch (paddylaunch-deactivatedaccount) wrote : Re: [Bug 1010608] Re: mate-power-manager power button settings ignored

It seems that quite a few things have been broken by code still
referring to 'gnome' instead of 'mate'.

Revision history for this message
Tanco (smarkovik) wrote :

works like a charm.. thanks

Revision history for this message
Jeshurun (sjeshurun) wrote :

Awesome thanks, that worked for me as well. Alienware M14x R2, Mint 13 x64.

Revision history for this message
Martin Habovštiak (martin-r24) wrote :

Works for me, thanks!
BTW how can I setup "Do nothing" on button press? (If I accidentally press button I don't want my computer to display any dialog)

Revision history for this message
Pistolpete (petervanbouwel) wrote :

This patch works great. Does exactly as told on a Dell E6520.

If you want the do nothing there are instructions on http://www.linuxandlife.com/2012/07/how-to-customize-power-management-in.html

Revision history for this message
stone (sfystone) wrote :

Thanks to #4. And I'd like to share my work around on Fedora 17.

Modify /etc/acpi/actions/power.sh

Add one line of $2 ~ /mate-power-manager/ ||
And it becomes like:

# Check that there is a power manager, otherwise shut down.
[ "$uid_session" ] &&
ps axo uid,cmd | \
awk '
    $1 == '$uid_session' &&
        ($2 ~ /gnome-power-manager/ || $2 ~ /kpowersave/ ||
         $2 ~ /xfce4-power-manager/ || $2 ~ /\/usr\/libexec\/gnome-settings-daemon/ ||
         $2 ~ /mate-power-manager/ ||
         $2 ~ /kded4/ || $3 ~ /guidance-power-manager/) \
                { found = 1; exit }
    END { exit !found }
' ||
  shutdown -h now

Revision history for this message
stone (sfystone) wrote :

Well.... I never know this forum is with no edit function.
The #16 work around is not working. The added line should be $2 ~ /mate-settings-daemon/ ||
But the deamon is not running(Should be a bug). So the change make computer do nothing upon power button under Mate.

Revision history for this message
maksim (m.arutyunyan) wrote :

Hi,

Still have this bug in Linux Mint 14 MATE 32bit (solution from post#4 works well).

Regards.

Revision history for this message
Karthik T (sir-nigel-loring) wrote :

Hans-Christoph's fix works works perfectly for me as well, thanks!

Revision history for this message
asettico (asettico) wrote :

The patch at #4 work also for Linux Mint 14 Nadia 64 bit.
Thanks!

Revision history for this message
Karthik T (sir-nigel-loring) wrote :

Dissapointed to see the problem has not been fixed in Linux Mint 14.. The mentioned fix still works.

Revision history for this message
HXT (voegel4711) wrote :

Post #4 works really fine.. For me it's on Mint 13 32bit.

@Developers: Why didn't you fix this bug allready? The mentioned workaround is no more than adding the correct parameter to a script which is triggered when pressing the PWR-Button, as far as I understand.

Revision history for this message
Miroslav (dzundam-deactivatedaccount) wrote :

I'd like to add, that similar patch as per post #4 fixed the "suspend" button on my laptop.

mate-power-manager sleep-button settings were ignored, laptop always went into sleep
after pressing sleep-button, despite I set 'nothing' in the action.

I fixed this by adding one line to the /usr/share/acpi-support/policy-funcs script:

PMS="gnome-power-manager kpowersave xfce4-power-manager"
        PMS="$PMS guidance-power-manager.py dalston-power-applet"
        PMS="$PMS mate-power-manager"

It seems acpi in Mint 13 (Mate) is not configured with mate-power-manager in mind.

I haven't dug, whether this has been fixed in upstream acpi.

Revision history for this message
martywd (martywd) wrote :

I hadn't checked back here in quite a while but as noted above I have found too this is still an issue in LM 14 MATE 64-bit.

I didn't know about the added scripting option(s). Instead I've been editing/commenting out the last line in the /etc/acpi/powerbtn.sh file like so:

#/sbin/shutdown -h now "Power button pressed"

Save file/exit.

This simple mod has worked for me in both LM 13 and LM 14, preventing an immediate shutdown from a power button press and instead yielding a prompt for further action(s).
.

Revision history for this message
Miroslav (dzundam-deactivatedaccount) wrote :

to Martywd: the acpid and acpi-support isn't configured with mate-power-manager
in mind, thus the editing of the acpi config files is needed. Simply acpi scripts take
over the computer control, because they 'think' there is no other power managing
application running.

You can try the step from post #23, it fixes the acpi.

The other solution is to simply uninstall the packages acpid and acpi-support.
In my case the system started to behave normally and without any negative
side effects.

Your edit of the script is simply the another way to get the desired behaviour.

Revision history for this message
martywd (martywd) wrote :

Ok, forget my mod in comment #24. Hans-Christoph's suggested fix in comment #4 seems the more appropriate solution to this push power button / immediate shutdown issue and for me it solves the issue in both LM13 and LM14.

@Miroslav
Your suggested mod in comment #23 didn't change the press power button/immediate shutdown issue for me whereas Hans-Christoph's suggestion did.

But, Miroslav, your suggested mod of the '/usr/share/acpi-support/policy-funcs' has fixed another 'Suspend' issue I've been having on a recently acquired laptop (LM14 MATE 64-bit). The problem was, when suspending the laptop using the Fn+... combo keys the laptop would suspend. But on the next press of the power button (or re-opening of the laptop's lid) to wake the laptop back up, the login screen would light up, but immediately return to suspend resulting in a required second press of the power button. Once the display came up a second time, the laptop would remain powered on thus allowing login, etc.

This was only happening when the laptop was suspended using the Fn+... keys. I.e., if I simply pressed the power button (or clicked 'Menu Button | Quit' in the MATE menu) and then clicked the 'Suspend' button at the gui popup prompt, the laptop would suspend and with another press of the power button the laptop would power up and remain powered on.

Adding the'PMS="$PMS mate-power-manager" line to the /usr/share/acpi-support/policy-funcs' script as per your instructions in comment #23 has fixed this suspend using the Fn+... keys issue. Now when resuming from a Fn+... key press suspend, I haven't had any further false starts.
.

Revision history for this message
Miroslav (dzundam-deactivatedaccount) wrote :

@Martywd: you are right, mod from post #4 fixes the power button behaviour and mod from post #23 the suspend button behaviour.

Both mods are basically the same, only located in the different acpi scripts (one responsible for acpi shutdown and another for acpi sleep). Both scripts by default don't check for the presence of mate-power-manager running as they should, after the mods they do.

Revision history for this message
Fabio Amaral (fabiom2) wrote :

Fisrt at all, thank you very much to Hans-Christoph. (#4), the solution is simply and perfect. But this is still a issue in Linux MInt 15 MATE (both 32 and 64bits tested).

Simon741 (simon-okko)
Changed in linuxmint:
status: In Progress → Confirmed
Revision history for this message
Simon741 (simon-okko) wrote :

I confirm that the problem is still present in Linux Mint 15 (and that Hans-Christoph's solution still works.

What could we do that this gets committed?

Revision history for this message
Mauro (mauromol) wrote :

The same problem applies to Linux Mint 16 KDE (64-bit). Can this be fixed?

Revision history for this message
Mauro (mauromol) wrote :

I think this bug is fixed in Linux Mint 16 for Mate (the check for mate-settings-daemon is present in /etc/acpi/powerbtn.sh), so I think this bug should be closed.
Instead, it still affects Linux Mint 16 KDE. I opened bug #1306912 for this, with the workaround I've found to fix the problem. Is there someone from Linux Mint reading here?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.