My system is turning off or suspending itself

Sometimes my system become full black screen and just completely turn off or keep gets suspending.(Not everytime). I am new to a linux distro , so i dont have any further knowledge to describe it. Although here are the logs,

6:40:05 PM kernel: PM: suspend entry (deep)
 6:40:05 PM systemd-sleep: Entering sleep state 'suspend'...
 6:40:05 PM systemd: Starting systemd-suspend.service - System Suspend...
 6:40:04 PM wpa_supplicant: nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
 6:40:04 PM chronyd: Source 195.176.26.206 offline
 6:40:04 PM NetworkManager: <info>  [1671887404.6221] device (wlp2s0): set-hw-addr: reset MAC address to 80:30:49:57:1C:AF (unmanage)
 6:40:04 PM firewalld: NETFILTER_CFG table=firewalld:7 family=1 entries=5 op=nft_unregister_rule pid=813 subj=system_u:system_r:firewalld_t:s0 comm="firewalld"
 6:40:04 PM NetworkManager: <info>  [1671887404.6101] device (wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
 6:40:04 PM avahi-daemon: Interface wlp2s0.IPv4 no longer relevant for mDNS.
 6:40:04 PM systemd-resolve: wlp2s0: Bus client reset DNS server list.
 6:40:04 PM avahi-daemon: Withdrawing address record for 192.168.1.7 on wlp2s0.
 6:40:04 PM systemd-resolve: wlp2s0: Bus client set default route setting: no
 6:40:04 PM avahi-daemon: Registering new address record for 192.168.1.7 on wlp2s0.IPv4.
 6:40:04 PM gnome-shell: An active wireless connection, in infrastructure mode, involves no access point?
 6:40:04 PM NetworkManager: <info>  [1671887404.5862] device (wlp2s0): set-hw-addr: set MAC address to 56:05:22:D2:63:BA (scanning)
 6:40:04 PM avahi-daemon: Withdrawing address record for 192.168.1.7 on wlp2s0.
 6:40:04 PM NetworkManager: <info>  [1671887404.5726] dhcp6 (wlp2s0): state changed no lease
 6:40:04 PM wpa_supplicant: wlp2s0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=IN
 6:40:04 PM avahi-daemon: Interface wlp2s0.IPv6 no longer relevant for mDNS.
 6:40:04 PM NetworkManager: <info>  [1671887404.5643] device (wlp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
 6:40:04 PM wpa_supplicant: wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
 6:40:04 PM kernel: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
 6:40:04 PM systemd: Started NetworkManager-dispatcher.service - Network Manager Script Dispatcher Service.
 6:40:04 PM NetworkManager: <info>  [1671887404.0417] device (wlp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
 6:40:04 PM kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20220331/evevent-255)
 6:40:03 PM systemd-logind: Power key pressed short.
 6:40:03 PM systemd: Stopped cgroupify@app-glib-google\x2dchrome-3152.scope.service.
 6:38:59 PM kernel: BPF prog-id=0 op=UNLOAD
 6:38:59 PM kernel: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-timedated comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
 6:38:59 PM systemd: systemd-timedated.service: Deactivated successfully.
 6:38:59 PM gnome-character: JS LOG: Characters Application exiting
 6:38:51 PM systemd: Started dbus-:1.2-org.gnome.Logs@0.service.
 6:38:50 PM dleyna-renderer: dLeyna: Exit
 6:38:49 PM packagekitd: resolve transaction /2509_ebdcadbb from uid 1000 finished with success after 20ms
 6:38:49 PM dleyna-renderer: Client :1.115 lost
 6:38:49 PM systemd: Started dbus-:1.2-com.intel.dleyna\x2drenderer@1.service.
 6:38:49 PM gnome-character: JS LOG: Characters Application started
 6:38:48 PM nautilus: Source ID 175 was not found when attempting to remove it
 6:38:48 PM gnome-shell: Received error from D-Bus search provider firefox.desktop: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
 6:38:48 PM systemd: Started gnome-terminal-server.service - GNOME Terminal Server.
 6:38:48 PM gnome-shell: Received error from D-Bus search provider firefox.desktop: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
 6:38:48 PM systemd: Starting gnome-terminal-server.service - GNOME Terminal Server...
 6:38:48 PM gnome-shell: Received error from D-Bus search provider firefox.desktop: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
 6:38:48 PM kernel: BPF prog-id=0 op=UNLOAD
 6:38:48 PM kernel: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-localed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
 6:38:48 PM systemd: systemd-localed.service: Deactivated successfully.
 6:38:43 PM dleyna-renderer: dLeyna: Exit
 6:38:43 PM tracker-miner-f: Could not add mark for path '/home/adithyan/.local/share/applications': Invalid cross-device link
 6:38:42 PM dleyna-renderer: Client :1.102 lost
 6:38:42 PM tracker-miner-f: Endpoint failed to fully write cursor: Interrupted

 6:38:41 PM gnome-character: JS LOG: Characters Application exiting

If this logs is not sufficient, i can provide some other long logs.

Is it some issue with my power button?? Please help its important

If you just want to disable automatic suspend/hybernate, then I think entering the following commands in a terminal ought to do it.

$ sudo mkdir /etc/systemd/sleep.conf.d
$ echo -e "[Sleep]\nAllowSuspend=no\nAllowHibernation=no\nAllowSuspendThenHibernate=no\nAllowHybridSleep=no" | sudo tee /etc/systemd/sleep.conf.d/override.conf
$ sudo systemctl daemon-reload

The above settings will persist across reboots. If you later decide that you want to undo the change and re-enable suspend mode, delete the /etc/systemd/sleep.conf.d/override.conf file.

Can you tell me why is this happening? It’s happening continuously now.

Now it’s showing a shutting down in 60s pop up and turning off immediately, even I click cancel (sometimes).

That does sound like your power switch is shorted. That or maybe your laptop battery is dead? With some laptops, you can remove the battery and run it directly from the wall power outlet.

I don’t think its an issue with battery, i guess its a problem with my power button. Can you give the command to disable power off by button press? I will do it by a terminal command or something.

I’ve never tried this, so I don’t know if it will work, but according to the documentation (man logind.conf):

$ sudo mkdir /etc/systemd/logind.conf.d
$ echo -e "[Login]\nHandlePowerKey=ignore\nHandlePowerKeyLongPress=ignore" | sudo tee /etc/systemd/logind.conf.d/override.conf
$ sudo systemctl daemon-reload

Edit: I expect that if the power switch is physically damaged, the system might just hard-poweroff instead of going through the normal shutdown sequence. I think the only way you are going to get around that is to fix the switch.

1 Like

Thanks bro for advice, you are a life saver :slight_smile: