• Support
  • Power button action - shutdown

tomocafe
When should I "Set "Power Button Action" to "Suspend" and then back to "Power Off"."?
Haven't done that yet.

    SOLUSfiddler
    That message is normal. You should see more messages than that. Did you use the -v flag?

    SOLUSfiddler
    In this order:

    1. In terminal, launch settings in verbose mode: gnome-control-center -v
    2. Set Power Button Action to Suspend
    3. Set Power Button Action to Power Off
    4. Close Settings

    Then you should see some debug messages in the terminal.

      tomocafe
      I see, changing the settings WHILST the terminal is open!

      This is the output:
      (process:3594): Gtk-CRITICAL **: 22:50:03.976: gtk_style_context_add_provider_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
      22:50:04.0346 GLib: DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
      22:50:04.0361 cc-object-storage: DEBUG: Finished creating D-Bus proxy for CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Screen)
      22:50:04.0361 cc-object-storage: DEBUG: Adding object GDBusProxy (CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Screen) → 0x14c2e20) to the storage
      22:50:04.0361 power-cc-panel: DEBUG: ALS enabled: on
      22:50:04.0361 cc-object-storage: DEBUG: Finished creating D-Bus proxy for CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Keyboard)
      22:50:04.0361 cc-object-storage: DEBUG: Adding object GDBusProxy (CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Keyboard) → 0x7f6704008560) to the storage
      22:50:04.0362 diagnostics-cc-panel: DEBUG: ABRT vanished
      22:50:04.0362 power-cc-panel: DEBUG: ALS enabled: on
      (gnome-control-center:3594): dconf-DEBUG: 22:50:11.365: change_fast
      (gnome-control-center:3594): dconf-DEBUG: 22:50:11.365: change_notify: /org/gnome/settings-daemon/plugins/power/power-button-action
      22:50:11.0366 power-cc-panel: DEBUG: ALS enabled: on
      (gnome-control-center:3594): dconf-DEBUG: 22:50:15.178: change_fast
      (gnome-control-center:3594): dconf-DEBUG: 22:50:15.179: change_notify: /org/gnome/settings-daemon/plugins/power/power-button-action
      22:50:15.0179 power-cc-panel: DEBUG: ALS enabled: on

      Some other tests to run:

      dmesg | grep -i button

      In your terminal, give the command xev. Don't move the mouse / press any keys. Then press your power button as you watch the terminal. Did anything change when you pressed the power button? If not, the system is not reading your power button press.

        tomocafe
        I entered dmesg | grep -i button.
        Output:
        [ 4.159768] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input3
        [ 4.164040] ACPI: Sleep Button [SLPB]
        [ 4.164107] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
        [ 4.166549] ACPI: Power Button [PWRF]
        [ 4.302429] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input6
        [ 5.616309] psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3

        The I entered xev, but it wasn't accepted:
        bash: xev: Kommando nicht gefunden.
        (Means "command not found")

          SOLUSfiddler You can get it with sudo eopkg it xev. But I see you are using ThinkPad. I remember that it takes a full second of pushing the power button for it to send the event signal. Silly question, but are you pushing the button long enough?

            tomocafe
            Will try the new command in a second.
            Do I have to push the power button for as long as it would take to give me the shutdown confirmation dialogue?
            Is that what you mean?
            (I'm using a Thinkpad W530, yes!)

            tomocafe
            I downloaded and installed xev, then pressed the power button whilst watching the open terminal.
            I kept the button pressed (nothing happened in the terminal) until the system was powered off.
            What now?

              SOLUSfiddler Err, sorry. Maybe you held it a bit too long. Try a quick push. If nothing shows up in the terminal, try for 1 second, but not too much longer. If you hold it down it probably does a force shutdown.

                tomocafe
                OK, I ran xev, this is the output of then pressing the power button for about one second:

                MappingNotify event, serial 38, synthetic NO, window 0x0,
                request MappingKeyboard, first_keycode 8, count 248

                FocusOut event, serial 38, synthetic NO, window 0x3400001,
                mode NotifyGrab, detail NotifyAncestor

                FocusIn event, serial 39, synthetic NO, window 0x3400001,
                mode NotifyUngrab, detail NotifyAncestor

                KeymapNotify event, serial 39, synthetic NO, window 0x0,
                keys: 92 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

                0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

                  tomocafe Below is my output:

                  elcobi@hp-pavilion ~ $ gnome-control-center -v
                  
                  (process:7956): Gtk-CRITICAL **: 11:11:19.791: gtk_style_context_add_provider_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
                  11:11:20.0202                      GLib:    DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
                  11:11:20.0219         cc-object-storage:    DEBUG: Finished creating D-Bus proxy for CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Keyboard)
                  11:11:20.0219         cc-object-storage:    DEBUG: Adding object GDBusProxy (CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Keyboard) → 0xf8e640) to the storage
                  11:11:20.0219         cc-object-storage:    DEBUG: Finished creating D-Bus proxy for CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Screen)
                  11:11:20.0219         cc-object-storage:    DEBUG: Adding object GDBusProxy (CcObjectStorage::dbus-proxy(org.gnome.SettingsDaemon.Power,/org/gnome/SettingsDaemon/Power,org.gnome.SettingsDaemon.Power.Screen) → 0x7f9dac008cf0) to the storage
                  11:11:20.0219            power-cc-panel:    DEBUG: ALS enabled: on
                  11:11:20.0220      diagnostics-cc-panel:    DEBUG: ABRT vanished
                  11:11:20.0221            power-cc-panel:    DEBUG: ALS enabled: on
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:27.424: change_fast
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:27.424: change_notify: /org/gnome/settings-daemon/plugins/power/power-button-action
                  11:11:27.0424            power-cc-panel:    DEBUG: ALS enabled: on
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:33.649: change_fast
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:33.650: change_notify: /org/gnome/settings-daemon/plugins/power/power-button-action
                  11:11:33.0650            power-cc-panel:    DEBUG: ALS enabled: on
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:36.480: unwatch_fast: "/org/gnome/desktop/session/" (active: 1, establishing: 0)
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:36.483: unwatch_fast: "/org/gnome/settings-daemon/plugins/power/" (active: 1, establishing: 0)
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:36.488: unwatch_fast: "/org/gnome/control-center/" (active: 1, establishing: 0)
                  (gnome-control-center:7956): dconf-DEBUG: 11:11:36.488: sync
                  11:11:36.0489         cc-object-storage:    DEBUG: Destroying cached objects

                    elcobi How about dmesg | grep -i button? Thanks for helping to debug.

                    SOLUSfiddler So it is receiving something when you press the power button. But what I'm wondering is if what it's receiving is not a power button event, but a sleep button event, which GNOME might not be using as a trigger to launch the "Power Button Action".

                    When I give dmesg | grep -i button, I have two power "buttons": PWRB and PWRF. If I understand correctly, PWRB is a normal power button press. When I short press it, this is the button that gets received and then GNOME is showing the shutdown dialog as desired. PWRF is for Force shutdown (?) when you hold down the power button.

                    Can anyone else confirm this? Also, if this was working for you before, I wonder if something in the kernel or ACPI domain changed causing this.

                      tomocafe
                      Hi!
                      Just gave dmesg | grep -i button again and this is the output:

                      [ 4.012866] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input3
                      [ 4.029803] ACPI: Sleep Button [SLPB]
                      [ 4.029901] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
                      [ 4.031788] ACPI: Power Button [PWRF]
                      [ 4.178622] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input6
                      [ 5.496297] psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3

                      And, yes - it used to work perfectly and every single time before.

                      [Will be back tomorrow - stay safe and sleep tight!]
                      SOLUSfiddler

                      So I was finally able to reproduce this. Unfortunately, I have no idea what the root cause is. I powered off my machine at least thirty times and tested. About half the time it’s working, the other times not.

                      When I run sudo journalctl -f in the terminal and then press the power button, I always see a message stating that the power button was pressed (i.e. the event is received) but on some boots, gnome-session-binary shows the shutdown dialog and it’s recorded in the journal; on other boots, nothing happens after the button event is recorded.

                      I even compared the journal entries from the working and non-working boots, but didn’t see any obvious differences.

                      Will keep digging around, but does anyone else have a hint or suggestion?