Laptop sometimes powers down on lid close instead of suspend

I’m running Fedora 44 on a 2013 MacBook Air. When I close the lid it sometimes enters suspend-to-ram as expected, but often it powers down entirely instead. I have not noticed any pattern as far as when it shuts down and when it enters suspend. How can I troubleshoot this behavior?

I’d start by checking the logs to see if Fedora is actually shutting down or if the laptop is losing power while suspended.

After it happens and you turn the laptop back on, open a terminal and run:

journalctl -b -1 --no-pager | tail -50

This shows the end of the previous boot. If the logs stop around the time you closed the lid, it might have crashed or lost power during suspend. If you see a shutdown message, that gives us another clue.

Also, check your battery health with:

upower -i "$(upower -e | grep -i BAT | head -1)"

Try to notice whether this happens only on battery power or also when the charger is plugged in.

Share the output of these commands, and we can narrow it down. I’d check these first rather than assume it’s a bad battery.

Here’s the output from journalctl -b -1 --no-pager | tail -50:

Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.6859] device (wlp3s0): state change: deactivating -> disconnected (reason 'sleeping', managed-type: 'full')
Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: Channel list changed: 6 GHz was enabled
Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Oct 25 22:49:31 picard avahi-daemon[1113]: Withdrawing address record for 2600:4040:255f:8f00:47f7:aee4:82a3:5b0e on wlp3s0.
Oct 25 22:49:31 picard avahi-daemon[1113]: Leaving mDNS multicast group on interface wlp3s0.IPv6 with address 2600:4040:255f:8f00:47f7:aee4:82a3:5b0e.
Oct 25 22:49:31 picard avahi-daemon[1113]: Joining mDNS multicast group on interface wlp3s0.IPv6 with address fe80::97a:30a8:1a01:a3ab.
Oct 25 22:49:31 picard avahi-daemon[1113]: Registering new address record for fe80::97a:30a8:1a01:a3ab on wlp3s0.*.
Oct 25 22:49:31 picard avahi-daemon[1113]: Withdrawing address record for fe80::97a:30a8:1a01:a3ab on wlp3s0.
Oct 25 22:49:31 picard avahi-daemon[1113]: Leaving mDNS multicast group on interface wlp3s0.IPv6 with address fe80::97a:30a8:1a01:a3ab.
Oct 25 22:49:31 picard avahi-daemon[1113]: Interface wlp3s0.IPv6 no longer relevant for mDNS.
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.6883] dhcp4 (wlp3s0): canceled DHCP transaction
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.6883] dhcp4 (wlp3s0): activation: beginning transaction (timeout in 45 seconds)
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.6883] dhcp4 (wlp3s0): state changed no lease
Oct 25 22:49:31 picard avahi-daemon[1113]: Withdrawing address record for 192.168.1.114 on wlp3s0.
Oct 25 22:49:31 picard avahi-daemon[1113]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.114.
Oct 25 22:49:31 picard avahi-daemon[1113]: Interface wlp3s0.IPv4 no longer relevant for mDNS.
Oct 25 22:49:31 picard chronyd[1117]: Source 192.231.84.116 offline
Oct 25 22:49:31 picard chronyd[1117]: Source 23.150.41.122 offline
Oct 25 22:49:31 picard chronyd[1117]: Source 66.187.4.132 offline
Oct 25 22:49:31 picard chronyd[1117]: Can't synchronise: no selectable sources (4 unreachable sources)
Oct 25 22:49:31 picard chronyd[1117]: Source 162.159.200.1 offline
Oct 25 22:49:31 picard systemd-resolved[820]: wlp3s0: Bus client reset search domain list.
Oct 25 22:49:31 picard audit: BPF prog-id=84 op=UNLOAD
Oct 25 22:49:31 picard audit[820]: SYSCALL arch=c000003e syscall=3 success=yes exit=0 a0=1a a1=5585f3f75a00 a2=7fef683f4ec0 a3=0 items=0 ppid=1 pid=820 auid=4294967295 uid=984 gid=979 euid=984 suid=984 fsuid=984 egid=979 sgid=979 fsgid=979 tty=(none) ses=4294967295 comm="systemd-resolve" exe="/usr/lib/systemd/systemd-resolved" subj=system_u:system_r:systemd_resolved_t:s0 key=(null)
Oct 25 22:49:31 picard audit: PROCTITLE proctitle="/usr/lib/systemd/systemd-resolved"
Oct 25 22:49:31 picard dnsmasq[2913]: reading /etc/resolv.conf
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.7153] device (wlp3s0): supplicant interface state: completed -> disconnected
Oct 25 22:49:31 picard dnsmasq[2913]: using nameserver 127.0.0.53#53
Oct 25 22:49:31 picard NetworkManager[1605]: <info>  [1792982971.7159] device (wlp3s0): state change: disconnected -> unmanaged (reason 'unmanaged-nm-disabled', managed-type: 'full')
Oct 25 22:49:31 picard systemd-resolved[820]: wlp3s0: Bus client set default route setting: no
Oct 25 22:49:31 picard systemd-resolved[820]: wlp3s0: Bus client reset DNS server list.
Oct 25 22:49:31 picard geoclue[4414]: WiFi scan failed
Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
Oct 25 22:49:31 picard wpa_supplicant[2100]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
Oct 25 22:49:31 picard wpa_supplicant[2100]: nl80211: deinit ifname=wlp3s0 disabled_11b_rates=0
Oct 25 22:49:31 picard audit[1126]: NETFILTER_CFG table=firewalld:36 family=1 entries=33 op=nft_unregister_rule pid=1126 subj=system_u:system_r:firewalld_t:s0 comm="firewalld"
Oct 25 22:49:32 picard gnome-shell[4890]: Type GITypeInfo of property AccountsService.User::password-mode does not match return type GITypeInfo of getter get_password_mode. Falling back to slow path
Oct 25 22:49:32 picard gnome-shell[4890]: [system-monitor-next] applet disable
Oct 25 22:49:34 picard gnome-shell[4890]: Cursor update failed: drmModeAtomicCommit: Invalid argument
Oct 25 22:49:34 picard systemd[1]: Reached target sleep.target - Sleep.
Oct 25 22:49:34 picard systemd[1]: Starting systemd-suspend.service - System Suspend...
Oct 25 22:49:34 picard systemd[1]: session-2.scope: Unit now frozen-by-parent.
Oct 25 22:49:34 picard systemd[1]: user.slice: Unit now frozen.
Oct 25 22:49:34 picard systemd[1]: user-1000.slice: Unit now frozen-by-parent.
Oct 25 22:49:34 picard systemd-sleep[33480]: Successfully froze unit 'user.slice'.
Oct 25 22:49:34 picard systemd[1]: user@1000.service: Unit now frozen-by-parent.
Oct 25 22:49:34 picard systemd-sleep[33480]: Performing sleep operation 'suspend'...
Oct 25 22:49:34 picard kernel: PM: suspend entry (deep)

And the output from upower -i "$(upower -e | grep -i BAT | head -1)":

  native-path:          BAT0
  vendor:               ifixit
  model:                bq20z451
  power supply:         yes
  updated:              Tue 27 Oct 2026 06:57:12 AM EDT (10 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              5.662 Wh
    energy-empty:        0 Wh
    energy-full:         5.662 Wh
    energy-full-design:  36.48 Wh
    voltage-min-design:  7.6 V
    energy-rate:         0 W
    voltage:             8.339 V
    charge-cycles:       328
    percentage:          100%
    temperature:         32.5 degrees C
    capacity:            15.5208%
    technology:          lithium-ion
    icon-name:          'battery-full-charged-symbolic'
  History (voltage):
    1793098602	8.339	fully-charged
    1793098572	8.336	fully-charged
    1793098542	8.337	fully-charged

Your battery is pretty weak. It reports only 15.5% of its original capacity, even though it shows 100% charged, but that doesn’t necessarily mean it’s causing this issue.

Since the logs show the system entering deep suspend, could you run:

cat /sys/power/mem_sleep

If it lists both s2idle and deep, try switching to s2idle temporarily:

echo s2idle | sudo tee /sys/power/mem_sleep

Then close the lid a few times and see if the problem still happens. This change is temporary and will reset after reboot.

Also, does this happen when the charger is plugged in, or only when running on battery?

That’s worse than I realized. But after these shutdown instances I routinely power the laptop back up on battery and it then reports a similar charge level to what it had prior to closing the lid. So I could imagine the problem being battery related, but it isn’t simply a matter of the battery getting completely discharged.

I don’t recall this happening while the charger is plugged in, but that might be simply due to the fact that I rarely close the lid with the charger connected.

I’ll try the /sys/power/mem_sleep suggestion later when I’m at the computer in question.

After switching to s2idle I haven’t seen any unexpected power-offs when I close the lid. But the power-offs weren’t happening every time so I’ll keep monitoring.

Thanks for testing it. Since you haven’t seen any unexpected power-offs with s2idle so far, that’s a good sign. Keep monitoring it for a while and see if the issue comes back. If it does, we can look into it further.