• Support
  • Power button action - shutdown

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?