How to lock screen on suspend?

I am using 18.04 fresh install. When I click suspend from the indicator applet in my tray area, on resume it does not prompt me with a lock screen. I have a screensaver and it is set to lock when active. This is a change in behavior from 16.04 and 17.10 for my laptop.

I found an older thread from two years ago with a similar issue. From there I found a workaround that I can suspend and lock as expected if I press my laptop's physical power button while it is set to suspend. However, old habits die hard and I keep clicking on my tray button's suspend. :frowning:

Is there any setting to change this behavior back to lock again on suspend when using the tray area's button?

1 Like

Hi @jayl,

have you tried changing the shortcuts at all? (Control Centre > Hardware > Keyboard Shortcuts):

1 Like

Hello. All of my shortcuts are default (lock screen on Ctrl+Alt+L). I tried disabling / setting to Alt+J / Ctrl+J just now, but none of those made any difference.

Hi,

I really don’t have an answer for you, you can try searching the following pages for more help:

https://help.ubuntu.com/stable/ubuntu-help/power-suspend.html

http://manpages.ubuntu.com/manpages/xenial/man8/pm-action.8.html

This is for 17.10 but should still apply!:

http://ubuntuhandbook.org/index.php/2017/10/enable-hibernate-ubuntu-17-10/

I hope it helps. :smiley:

Also noticed this. Just moved to Mate from Mint, and I’m finding a few niggles like this.

I have been facing the same issue for some time now. Suspend always locked my screen at first, but suddenly it stopped happening.

I opened a thread here a while ago but didn’t get any info.

It’s probably related to an update that’s caused this to happen, since it was fine at first.

Hello,

That’s my first post on this community and just would like to thanks all the Ubuntu Mate team for their works.

I had the same problem and upon suspend or hibernate I never had my screen locked which is very annoying (same facts on multiple computer and I don’t know why).

I have searched about this many times and found nothing.

I have created the following systemd unit file as a workaround.

loginctl–lock-sessions.service

[Unit]
Description=loginctl lock-sessions on sleep
Documentation=man:loginctl(1)
Before=sleep.target

[Service]
Type=oneshot
ExecStartPre=/usr/bin/logger --tag "loginctl" --priority auth.info "Session: Locking all user sessions"
ExecStart=/bin/loginctl lock-sessions
RemainAfterExit=no
StandardOutput=journal

[Install]
#Alias=sleep.target/loginctl--lock-sessions.service
WantedBy=sleep.target

1- copy this file loginctl–lock-sessions.service to /etc/systemd/system
2- $ sudo systemctl enable loginctl–lock-sessions.service

Now my screen is always locked after suspending or hibernating.

Hope this could help someone.

Kind Regards

6 Likes

@moocan thanks for this. I tried it and after a restart it seems to work well. :joy:

I didn’t expect someone to answer this thread after two months.

I have the same problem this should be fixed :smile:
So i installed it, i will be reporting back.

@moocan thanks for this

I tried adding the systemd file as described. Now the screen locks when the screensaver fires off! However it still doesn’t lock when I manually suspend the laptop. It just comes back to life with no lock on, even when the delay for the screensaver has been exceeded.

I wouldn’t mind so much if I could lock the screen with CTRL-ALT-L and then suspend from there, but there’s no option to suspend from the lock screen. So, still broken for me I’m afraid.

1 Like

I’m not sure if this is related, but I was checking the settings in the Power Manager, and I tried setting the Action on pressing the Power Button to Suspend. But pressing the power button doesn’t do anything whatever its set to; it just cuts the power after a 3 second delay.

Seems to work properly, although i had one occasion where it did not work.
But that event was a bit sketchy.

@moocan Thanks :smile:

Hello,

I’m sorry because I did not provide an explanation.

This little loginctl--lock-sessions.service systemd unit is only invoked when computer reached the systemd sleep.target which is called when computer goes to sleep, suspend, hibernate, and hybrid-sleep using systemd.

loginctl--lock-sessions.service is never invoked by the screensaver.
You can rename the loginctl--lock-sessions.service by using the name you want.

loginctl--lock-sessions.service rely only on systemd mechanism and just launch logger and loginctl lock-sessions. Unit is invoked by the sleep.target which is called by systemd-hibernate.service, systemd-suspend.service, systemd-hybrid-sleep.service … without additional package … only the base system.

As example: systemd-hibernate.service

This file is part of systemd.

systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

[Unit]
Description=Hibernate
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target

[Service]
Type=oneshot
ExecStart=/lib/systemd/systemd-sleep hibernate

This unit do the following actions:
First one :

ExecStartPre=/usr/bin/logger --tag “loginctl” --priority auth.info “Session: Locking all user sessions”

This will cause logger to write to the journal log an event:

juil. 05 04:46:46 … loginctl[20960]: Session: Locking all user sessions

Second one:

ExecStart=/bin/loginctl lock-sessions

loginctl --help

lock-sessions Screen lock all current sessions

So after restoring your computer from suspend or hibernate you can search in journal log if loginctl--lock-sessions.service has been launched by the sleep.target and if the sleep.target has been invoked … using journalctl

Using the logger tag:

$ journalctl -t loginctl

Using the systemd unit name:

$ journalctl -u loginctl–lock-sessions.service

This is only a little workaround to force screen to be locked on sleep.
You can replace loginctl lock-sessions with whatever you want coming from additional screen locking tools.

Regarding the mate screensaver (inactivity screensaver), i don’t know what to say … because I have troubles with it … sometimes screen is well locked and sometimes not :frowning: … so now WIN+L is a reflex !

Kr,

Hello,

Try to make a test using systemctl

$ sudo systemctl hibernate
$ sudo systemctl suspend

After restoring try to investigate using journalctl

journalctl --since YYYY-MM-DD HH:MM:SS

When you manually suspend your laptop, try to investigate too using journalctl to see if same steps are encountered.

Kr,

Good plan. OK I did a suspend via systemctl. The result was exactly the same as manually activating a suspend through the menu items. Here is the log. I added the ----- suspend ----- and -----resume----- lines myself for clarity.

[email protected]:~$ date
Wed Aug  8 14:25:18 +08 2018

[email protected]:~$ sudo systemctl suspend

[email protected]:~$ journalctl --since 14:25

------  suspending ------------
Aug 08 14:25:39 machine1 sudo[20433]:    user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl suspend
Aug 08 14:25:39 machine1 sudo[20433]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.3862] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.3866] manager: NetworkManager state is now ASLEEP
Aug 08 14:25:39 machine1 sudo[20433]: pam_unix(sudo:session): session closed for user root
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.3875] device (wlp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'man
Aug 08 14:25:39 machine1 whoopsie[1348]: [14:25:39] offline
Aug 08 14:25:39 machine1 dbus-daemon[891]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.3985] device (wlp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: '
Aug 08 14:25:39 machine1 avahi-daemon[885]: Withdrawing address record for fd89:9bdb:a20f::ba9 on wlp2s0.
Aug 08 14:25:39 machine1 systemd[1]: Starting Network Manager Script Dispatcher Service...
Aug 08 14:25:39 machine1 avahi-daemon[885]: Withdrawing address record for fd89:9bdb:a20f:0:e86b:e657:7531:55c3 on wlp2s0.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Withdrawing address record for fd89:9bdb:a20f:0:156c:455d:51f9:6d4 on wlp2s0.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Leaving mDNS multicast group on interface wlp2s0.IPv6 with address fd89:9bdb:a20f:0:156c:455d:51f9:6d4.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Joining mDNS multicast group on interface wlp2s0.IPv6 with address fe80::68f:2bd5:ff6a:fe34.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Registering new address record for fe80::68f:2bd5:ff6a:fe34 on wlp2s0.*.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Withdrawing address record for fe80::68f:2bd5:ff6a:fe34 on wlp2s0.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Leaving mDNS multicast group on interface wlp2s0.IPv6 with address fe80::68f:2bd5:ff6a:fe34.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Interface wlp2s0.IPv6 no longer relevant for mDNS.
Aug 08 14:25:39 machine1 dbus-daemon[891]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Aug 08 14:25:39 machine1 systemd[1]: Started Network Manager Script Dispatcher Service.
Aug 08 14:25:39 machine1 nm-dispatcher[20435]: req:1 'connectivity-change': new request (1 scripts)
Aug 08 14:25:39 machine1 nm-dispatcher[20435]: req:1 'connectivity-change': start running ordered scripts...
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4395] dhcp4 (wlp2s0): canceled DHCP transaction, DHCP client pid 19989
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4395] dhcp4 (wlp2s0): state changed bound -> done
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4411] dhcp6 (wlp2s0): canceled DHCP transaction, DHCP client pid 19997
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4412] dhcp6 (wlp2s0): state changed bound -> done
Aug 08 14:25:39 machine1 kernel: wlp2s0: deauthenticating from 54:36:9b:4b:50:46 by local choice (Reason: 3=DEAUTH_LEAVING)
Aug 08 14:25:39 machine1 wpa_supplicant[905]: wlp2s0: CTRL-EVENT-DISCONNECTED bssid=54:36:9b:4b:50:46 reason=3 locally_generated=1
Aug 08 14:25:39 machine1 avahi-daemon[885]: Withdrawing address record for 10.50.50.104 on wlp2s0.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Leaving mDNS multicast group on interface wlp2s0.IPv4 with address 10.50.50.104.
Aug 08 14:25:39 machine1 avahi-daemon[885]: Interface wlp2s0.IPv4 no longer relevant for mDNS.
Aug 08 14:25:39 machine1 wpa_supplicant[905]: wlp2s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Aug 08 14:25:39 machine1 whoopsie[1348]: [14:25:39] Cannot reach: https://daisy.ubuntu.com
Aug 08 14:25:39 machine1 nm-dispatcher[20435]: req:2 'down' [wlp2s0]: new request (1 scripts)
Aug 08 14:25:39 machine1 NetworkManager[904]: <warn>  [1533709539.4591] sup-iface[0x561283037da0,wlp2s0]: connection disconnected (reason -3)
Aug 08 14:25:39 machine1 nm-dispatcher[20435]: req:2 'down' [wlp2s0]: start running ordered scripts...
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4595] device (wlp2s0): supplicant interface state: completed -> disconnected
Aug 08 14:25:39 machine1 NetworkManager[904]: <info>  [1533709539.4607] device (wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'man
Aug 08 14:25:39 machine1 systemd[1]: Starting loginctl lock-sessions on sleep...
Aug 08 14:25:39 machine1 loginctl[20452]: Session: Locking all user sessions
Aug 08 14:25:39 machine1 wpa_supplicant[905]: nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
Aug 08 14:25:39 machine1 systemd[1]: Started loginctl lock-sessions on sleep.
Aug 08 14:25:39 machine1 systemd[1]: Reached target Sleep.
Aug 08 14:25:39 machine1 systemd[1]: Starting Suspend...
Aug 08 14:25:39 machine1 systemd[1]: Starting Restart Syncthing after resume...
Aug 08 14:25:39 machine1 systemd-sleep[20458]: Suspending system...
Aug 08 14:25:39 machine1 kernel: PM: suspend entry (deep)


------- resuming ---------
Aug 08 14:31:19 machine1 kernel: PM: Syncing filesystems ... done.
Aug 08 14:31:19 machine1 kernel: Freezing user space processes ... (elapsed 0.002 seconds) done.
Aug 08 14:31:19 machine1 kernel: OOM killer disabled.
Aug 08 14:31:19 machine1 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Aug 08 14:31:19 machine1 kernel: Suspending console(s) (use no_console_suspend to debug)
Aug 08 14:31:19 machine1 kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Aug 08 14:31:19 machine1 kernel: sd 0:0:0:0: [sda] Stopping disk
Aug 08 14:31:19 machine1 kernel: ACPI: EC: interrupt blocked
Aug 08 14:31:19 machine1 kernel: ACPI: Preparing to enter system sleep state S3
Aug 08 14:31:19 machine1 kernel: ACPI: EC: event blocked
Aug 08 14:31:19 machine1 kernel: ACPI: EC: EC stopped
Aug 08 14:31:19 machine1 kernel: PM: Saving platform NVS memory
Aug 08 14:31:19 machine1 kernel: Disabling non-boot CPUs ...
Aug 08 14:31:19 machine1 kernel: smpboot: CPU 1 is now offline
Aug 08 14:31:19 machine1 kernel: IRQ 118: no longer affine to CPU2
Aug 08 14:31:19 machine1 kernel: smpboot: CPU 2 is now offline
Aug 08 14:31:19 machine1 kernel: IRQ 121: no longer affine to CPU3
Aug 08 14:31:19 machine1 kernel: smpboot: CPU 3 is now offline
Aug 08 14:31:19 machine1 kernel: ACPI: Low-level resume complete
Aug 08 14:31:19 machine1 kernel: ACPI: EC: EC started
Aug 08 14:31:19 machine1 kernel: PM: Restoring platform NVS memory
Aug 08 14:31:19 machine1 kernel: Enabling non-boot CPUs ...
Aug 08 14:31:19 machine1 kernel: x86: Booting SMP configuration:
Aug 08 14:31:19 machine1 kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
Aug 08 14:31:19 machine1 kernel:  cache: parent cpu1 should not be sleeping
Aug 08 14:31:19 machine1 kernel: CPU1 is up
Aug 08 14:31:19 machine1 kernel: smpboot: Booting Node 0 Processor 2 APIC 0x4
Aug 08 14:31:19 machine1 kernel:  cache: parent cpu2 should not be sleeping
Aug 08 14:31:19 machine1 kernel: CPU2 is up
Aug 08 14:31:19 machine1 kernel: smpboot: Booting Node 0 Processor 3 APIC 0x6
Aug 08 14:31:19 machine1 kernel:  cache: parent cpu3 should not be sleeping
Aug 08 14:31:19 machine1 kernel: CPU3 is up
Aug 08 14:31:19 machine1 kernel: ACPI: Waking up from system sleep state S3
Aug 08 14:31:19 machine1 kernel: ACPI: EC: interrupt unblocked
Aug 08 14:31:19 machine1 kernel: ACPI: EC: event unblocked
Aug 08 14:31:19 machine1 kernel: rtlwifi: rtlwifi: wireless switch is on
Aug 08 14:31:19 machine1 kernel: sd 0:0:0:0: [sda] Starting disk
Aug 08 14:31:19 machine1 kernel: r8169 0000:03:00.0 enp3s0: link down
Aug 08 14:31:19 machine1 kernel: usb 1-4: reset full-speed USB device number 4 using xhci_hcd
Aug 08 14:31:19 machine1 kernel: ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
Aug 08 14:31:19 machine1 kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Aug 08 14:31:19 machine1 kernel: ata2.00: configured for UDMA/133
Aug 08 14:31:19 machine1 kernel: ata1.00: configured for UDMA/133
Aug 08 14:31:19 machine1 kernel: usb 1-5: reset high-speed USB device number 5 using xhci_hcd
Aug 08 14:31:19 machine1 kernel: usb 1-3: reset high-speed USB device number 3 using xhci_hcd
Aug 08 14:31:19 machine1 kernel: psmouse serio1: synaptics: queried max coordinates: x [..5702], y [..4886]
Aug 08 14:31:19 machine1 kernel: psmouse serio1: synaptics: queried min coordinates: x [1240..], y [964..]
Aug 08 14:31:19 machine1 kernel: acpi LNXPOWER:00: Turning OFF
Aug 08 14:31:19 machine1 kernel: OOM killer enabled.
Aug 08 14:31:19 machine1 kernel: Restarting tasks ... done.
Aug 08 14:31:19 machine1 bluetoothd[858]: Endpoint unregistered: sender=:1.42 path=/MediaEndpoint/A2DPSource
Aug 08 14:31:19 machine1 systemd[1]: Started Restart Syncthing after resume.
Aug 08 14:31:19 machine1 bluetoothd[858]: Endpoint unregistered: sender=:1.42 path=/MediaEndpoint/A2DPSink
Aug 08 14:31:19 machine1 NetworkManager[904]: <info>  [1533709879.3078] bluez5: NAP: removed interface C8:3D:D4:9F:2F:5E
Aug 08 14:31:19 machine1 bluetoothd[858]: Endpoint unregistered: sender=:1.123 path=/MediaEndpoint/A2DPSource
Aug 08 14:31:19 machine1 systemd[1]: Starting Load/Save RF Kill Switch Status...
Aug 08 14:31:19 machine1 bluetoothd[858]: Endpoint unregistered: sender=:1.123 path=/MediaEndpoint/A2DPSink
Aug 08 14:31:19 machine1 dbus-daemon[1683]: [session uid=1000 pid=1683] Activating service name='org.freedesktop.Notifications' requested by ':1.207' (uid=1000 pid=23541 
Aug 08 14:31:19 machine1 kernel: Bluetooth: hci0: rtl: examining hci_ver=06 hci_rev=000a lmp_ver=06 lmp_subver=8821
Aug 08 14:31:19 machine1 kernel: Bluetooth: hci0: rtl: loading rtl_bt/rtl8821a_config.bin
Aug 08 14:31:19 machine1 kernel: bluetooth hci0: Direct firmware load for rtl_bt/rtl8821a_config.bin failed with error -2
Aug 08 14:31:19 machine1 kernel: Bluetooth: hci0: rtl: loading rtl_bt/rtl8821a_fw.bin
Aug 08 14:31:19 machine1 kernel: Bluetooth: hci0: rom_version status=0 version=1
Aug 08 14:31:19 machine1 kernel: Bluetooth: hci0: cfg_sz 0, total size 17428
Aug 08 14:31:19 machine1 systemd-rfkill[20511]: Failed to open device rfkill16: No such device
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.123" (uid=1001 pid=19094 comm="/usr/bin/pulseaudio --
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.123" (uid=1001 pid=19094 comm="/usr/bin/pulseaudio --
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.123" (uid=1001 pid=19094 comm="/usr/bin/pulseaudio --
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.123" (uid=1001 pid=19094 comm="/usr/bin/pulseaudio --
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.42" (uid=1000 pid=1933 comm="/usr/bin/pulseaudio --st
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.42" (uid=1000 pid=1933 comm="/usr/bin/pulseaudio --st
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.42" (uid=1000 pid=1933 comm="/usr/bin/pulseaudio --st
Aug 08 14:31:19 machine1 dbus-daemon[891]: [system] Rejected send message, 1 matched rules; type="error", sender=":1.42" (uid=1000 pid=1933 comm="/usr/bin/pulseaudio --st
Aug 08 14:31:19 machine1 upowerd[1290]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.1
Aug 08 14:31:19 machine1 systemd[1]: bluetooth.target: Unit not needed anymore. Stopping.
Aug 08 14:31:19 machine1 systemd[1]: Stopped target Bluetooth.
Aug 08 14:31:19 machine1 upowerd[1290]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.1
Aug 08 14:31:19 machine1 upowerd[1290]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0
Aug 08 14:31:19 machine1 systemd[1]: Reached target Bluetooth.
Aug 08 14:31:19 machine1 systemd[1]: Started Load/Save RF Kill Switch Status.
Aug 08 14:31:19 machine1 upowerd[1290]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0
Aug 08 14:31:19 machine1 systemd-sleep[20458]: System resumed.
Aug 08 14:31:19 machine1 kernel: PM: suspend exit
Aug 08 14:31:19 machine1 dbus-daemon[1683]: [session uid=1000 pid=1683] Successfully activated service 'org.freedesktop.Notifications'
Aug 08 14:31:19 machine1 systemd[1]: Started Suspend.
Aug 08 14:31:19 machine1 systemd[1]: sleep.target: Unit not needed anymore. Stopping.
Aug 08 14:31:19 machine1 systemd[1]: Stopped target Sleep.
Aug 08 14:31:19 machine1 systemd[1]: Reached target Suspend.
Aug 08 14:31:19 machine1 systemd[1]: suspend.target: Unit not needed anymore. Stopping.
Aug 08 14:31:19 machine1 systemd[1]: Stopped target Suspend.
Aug 08 14:31:19 machine1 systemd-logind[865]: Operation 'sleep' finished.
Aug 08 14:31:19 machine1 NetworkManager[904]: <info>  [1533709879.5311] manager: sleep: wake requested (sleeping: yes  enabled: yes)
Aug 08 14:31:19 machine1 NetworkManager[904]: <info>  [1533709879.5312] device (enp3s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'mana
Aug 08 14:31:19 machine1 NetworkManager[904]: <info>  [1533709879.5542] device (enp3s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'manag
Aug 08 14:31:19 machine1 kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Aug 08 14:31:19 machine1 NetworkManager[904]: <info>  [1533709879.7348] device (wlp2s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'manag
Aug 08 14:31:19 machine1 kernel: r8169 0000:03:00.0 enp3s0: link down
Aug 08 14:31:19 machine1 kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Aug 08 14:31:19 machine1 kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
Aug 08 14:31:20 machine1 kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
Aug 08 14:31:20 machine1 NetworkManager[904]: <info>  [1533709880.0158] manager: NetworkManager state is now DISCONNECTED
Aug 08 14:31:20 machine1 wpa_supplicant[905]: dbus: fill_dict_with_properties dbus_interface=fi.w1.wpa_supplicant1.Interface dbus_property=Stations getter failed
Aug 08 14:31:20 machine1 wpa_supplicant[905]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
Aug 08 14:31:20 machine1 wpa_supplicant[905]: dbus: Failed to construct signal
Aug 08 14:31:20 machine1 wpa_supplicant[905]: dbus: fill_dict_with_properties dbus_interface=fi.w1.wpa_supplicant1.Interface dbus_property=Stations getter failed
Aug 08 14:31:20 machine1 NetworkManager[904]: <info>  [1533709880.0784] device (wlp2s0): supplicant interface state: starting -> ready
Aug 08 14:31:20 machine1 NetworkManager[904]: <info>  [1533709880.0786] device (wlp2s0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-ifa
Aug 08 14:31:20 machine1 kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for :1.123/Profile/HSPHSProfile/00001108-0000-1000-8000-00805f9b34fb: rfcomm_bind: Address already in use (
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Message Notification: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Message Access: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Phone Book Access: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Synchronization: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for File Transfer: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: RFCOMM server failed for Object Push: rfcomm_bind: Address already in use (98)
Aug 08 14:31:20 machine1 bluetoothd[858]: Endpoint registered: sender=:1.123 path=/MediaEndpoint/A2DPSource
Aug 08 14:31:20 machine1 NetworkManager[904]: <info>  [1533709880.2444] bluez5: NAP: added interface C8:3D:D4:9F:2F:5E
Aug 08 14:31:20 machine1 bluetoothd[858]: Endpoint registered: sender=:1.123 path=/MediaEndpoint/A2DPSink
Aug 08 14:31:20 machine1 bluetoothd[858]: Endpoint registered: sender=:1.42 path=/MediaEndpoint/A2DPSource
Aug 08 14:31:20 machine1 bluetoothd[858]: Endpoint registered: sender=:1.42 path=/MediaEndpoint/A2DPSink
Aug 08 14:31:22 machine1 ModemManager[887]: <info>  Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.2/0000:02:00.0': not supported by any plugin
Aug 08 14:31:22 machine1 ModemManager[887]: <info>  Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:03:00.0': not supported by any plugin
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2184] policy: auto-activating connection 'AP1'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2206] device (wlp2s0): Activation: starting connection 'AP1' (5021b605-7bc9-4c4a-8b45-f
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2212] device (wlp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2216] manager: NetworkManager state is now CONNECTING
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2227] device (wlp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2232] device (wlp2s0): Activation: (wifi) access point 'AP1' has security, but secrets 
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2233] device (wlp2s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2304] device (wlp2s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2311] device (wlp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2317] device (wlp2s0): Activation: (wifi) connection 'AP1' has security, and secrets ex
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2318] Config: added 'ssid' value 'AP1'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2319] Config: added 'scan_ssid' value '1'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2319] Config: added 'bgscan' value 'simple:30:-80:86400'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2320] Config: added 'key_mgmt' value 'WPA-PSK'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2320] Config: added 'auth_alg' value 'OPEN'
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2320] Config: added 'psk' value '<hidden>'
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: SME: Trying to authenticate with 54:36:9b:4b:50:46 (SSID='AP1' freq=2447 MHz)
Aug 08 14:31:23 machine1 kernel: wlp2s0: authenticate with 54:36:9b:4b:50:46
Aug 08 14:31:23 machine1 kernel: wlp2s0: send auth to 54:36:9b:4b:50:46 (try 1/3)
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: Trying to associate with 54:36:9b:4b:50:46 (SSID='AP1' freq=2447 MHz)
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2696] device (wlp2s0): supplicant interface state: ready -> authenticating
Aug 08 14:31:23 machine1 kernel: wlp2s0: authenticated
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2750] device (wlp2s0): supplicant interface state: authenticating -> associating
Aug 08 14:31:23 machine1 kernel: wlp2s0: associate with 54:36:9b:4b:50:46 (try 1/3)
Aug 08 14:31:23 machine1 kernel: wlp2s0: RX AssocResp from 54:36:9b:4b:50:46 (capab=0x431 status=0 aid=4)
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: Associated with 54:36:9b:4b:50:46
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Aug 08 14:31:23 machine1 kernel: wlp2s0: associated
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=PH
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.2929] device (wlp2s0): supplicant interface state: associating -> 4-way handshake
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: WPA: Key negotiation completed with 54:36:9b:4b:50:46 [PTK=CCMP GTK=CCMP]
Aug 08 14:31:23 machine1 wpa_supplicant[905]: wlp2s0: CTRL-EVENT-CONNECTED - Connection to 54:36:9b:4b:50:46 completed [id=0 id_str=]
Aug 08 14:31:23 machine1 wpa_supplicant[905]: bgscan simple: Failed to enable signal strength monitoring
Aug 08 14:31:23 machine1 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.3075] device (wlp2s0): supplicant interface state: 4-way handshake -> completed
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.3078] device (wlp2s0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful.  Connected to wire
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.3095] device (wlp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.3107] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
Aug 08 14:31:23 machine1 NetworkManager[904]: <info>  [1533709883.3177] dhcp4 (wlp2s0): dhclient started with pid 20543
Aug 08 14:31:23 machine1 dhclient[20543]: DHCPREQUEST of 10.50.50.104 on wlp2s0 to 255.255.255.255 port 67 (xid=0x1a5b2b0)
Aug 08 14:31:25 machine1 avahi-daemon[885]: Joining mDNS multicast group on interface wlp2s0.IPv6 with address fe80::68f:2bd5:ff6a:fe34.
Aug 08 14:31:25 machine1 avahi-daemon[885]: New relevant interface wlp2s0.IPv6 for mDNS.
Aug 08 14:31:25 machine1 avahi-daemon[885]: Registering new address record for fe80::68f:2bd5:ff6a:fe34 on wlp2s0.*.
Aug 08 14:31:25 machine1 NetworkManager[904]: <info>  [1533709885.6555] dhcp6 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
Aug 08 14:31:25 machine1 NetworkManager[904]: <info>  [1533709885.6616] dhcp6 (wlp2s0): dhclient started with pid 20550
Aug 08 14:31:26 machine1 dhclient[20543]: DHCPREQUEST of 10.50.50.104 on wlp2s0 to 255.255.255.255 port 67 (xid=0x1a5b2b0)
Aug 08 14:31:26 machine1 dhclient[20550]: XMT: Confirm on wlp2s0, interval 1030ms.
Aug 08 14:31:26 machine1 dhclient[20550]: RCV: Reply message on wlp2s0 from fe80::5636:9bff:fe4b:5046.
Aug 08 14:31:26 machine1 dhclient[20550]: message status code NotOnLink.
Aug 08 14:31:26 machine1 dhclient[20543]: DHCPACK of 10.50.50.104 from 10.50.50.1
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6877] dhcp4 (wlp2s0):   address 10.50.50.104
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6878] dhcp4 (wlp2s0):   plen 24 (255.255.255.0)
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6878] dhcp4 (wlp2s0):   gateway 10.50.50.1
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6879] dhcp4 (wlp2s0):   lease time 43200
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6879] dhcp4 (wlp2s0):   hostname 'machine1'
Aug 08 14:31:26 machine1 avahi-daemon[885]: Joining mDNS multicast group on interface wlp2s0.IPv4 with address 10.50.50.104.
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6879] dhcp4 (wlp2s0):   nameserver '10.50.50.1'
Aug 08 14:31:26 machine1 avahi-daemon[885]: New relevant interface wlp2s0.IPv4 for mDNS.
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6880] dhcp4 (wlp2s0):   domain name 'lan'
Aug 08 14:31:26 machine1 avahi-daemon[885]: Registering new address record for 10.50.50.104 on wlp2s0.IPv4.
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6880] dhcp4 (wlp2s0): state changed unknown -> bound
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6928] device (wlp2s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6947] device (wlp2s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6962] device (wlp2s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed'
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.6971] manager: NetworkManager state is now CONNECTED_LOCAL
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.7040] manager: NetworkManager state is now CONNECTED_SITE
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.7042] policy: set 'AP1' (wlp2s0) as default for IPv4 routing and DNS
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.7050] device (wlp2s0): Activation: successful, device activated.
Aug 08 14:31:26 machine1 dhclient[20543]: bound to 10.50.50.104 -- renewal in 19884 seconds.
Aug 08 14:31:26 machine1 NetworkManager[904]: <info>  [1533709886.7088] manager: NetworkManager state is now CONNECTED_GLOBAL
Aug 08 14:31:26 machine1 nm-dispatcher[20435]: req:3 'up' [wlp2s0]: new request (1 scripts)
Aug 08 14:31:26 machine1 nm-dispatcher[20435]: req:3 'up' [wlp2s0]: start running ordered scripts...
Aug 08 14:31:26 machine1 nm-dispatcher[20435]: req:4 'connectivity-change': new request (1 scripts)
Aug 08 14:31:26 machine1 whoopsie[1348]: [14:31:26] The default IPv4 route is: /org/freedesktop/NetworkManager/ActiveConnection/15
Aug 08 14:31:26 machine1 whoopsie[1348]: [14:31:26] Not a paid data plan: /org/freedesktop/NetworkManager/ActiveConnection/15
Aug 08 14:31:26 machine1 whoopsie[1348]: [14:31:26] Found usable connection: /org/freedesktop/NetworkManager/ActiveConnection/15
Aug 08 14:31:26 machine1 whoopsie[1348]: [14:31:26] online
Aug 08 14:31:26 machine1 avahi-daemon[885]: Leaving mDNS multicast group on interface wlp2s0.IPv6 with address fe80::68f:2bd5:ff6a:fe34.
Aug 08 14:31:26 machine1 avahi-daemon[885]: Joining mDNS multicast group on interface wlp2s0.IPv6 with address fd89:9bdb:a20f:0:156c:455d:51f9:6d4.
Aug 08 14:31:26 machine1 avahi-daemon[885]: Registering new address record for fd89:9bdb:a20f:0:156c:455d:51f9:6d4 on wlp2s0.*.
Aug 08 14:31:26 machine1 avahi-daemon[885]: Withdrawing address record for fe80::68f:2bd5:ff6a:fe34 on wlp2s0.
Aug 08 14:31:26 machine1 systemd[1]: Reloading OpenBSD Secure Shell server.
Aug 08 14:31:26 machine1 sshd[1080]: Received SIGHUP; restarting.
Aug 08 14:31:26 machine1 systemd[1]: Reloaded OpenBSD Secure Shell server.
Aug 08 14:31:26 machine1 sshd[1080]: Server listening on 0.0.0.0 port 222.
Aug 08 14:31:26 machine1 sshd[1080]: Server listening on :: port 222.
Aug 08 14:31:26 machine1 systemd[1]: Reloading OpenBSD Secure Shell server.
Aug 08 14:31:26 machine1 nm-dispatcher[20435]: req:4 'connectivity-change': start running ordered scripts...
Aug 08 14:31:27 machine1 sshd[1080]: Received SIGHUP; restarting.
Aug 08 14:31:27 machine1 systemd[1]: Reloaded OpenBSD Secure Shell server.
Aug 08 14:31:27 machine1 sshd[1080]: Server listening on 0.0.0.0 port 222.
Aug 08 14:31:27 machine1 sshd[1080]: Server listening on :: port 222.
Aug 08 14:31:27 machine1 dhclient[20550]: XMT: Solicit on wlp2s0, interval 1090ms.
Aug 08 14:31:27 machine1 dhclient[20550]: RCV: Advertise message on wlp2s0 from fe80::5636:9bff:fe4b:5046.
Aug 08 14:31:27 machine1 avahi-daemon[885]: Registering new address record for fd89:9bdb:a20f:0:e86b:e657:7531:55c3 on wlp2s0.*.
Aug 08 14:31:28 machine1 dhclient[20550]: XMT: Request on wlp2s0, interval 990ms.
Aug 08 14:31:28 machine1 dhclient[20550]: RCV: Reply message on wlp2s0 from fe80::5636:9bff:fe4b:5046.
Aug 08 14:31:28 machine1 NetworkManager[904]: <info>  [1533709888.4586] dhcp6 (wlp2s0):   valid_lft 4294967295
Aug 08 14:31:28 machine1 NetworkManager[904]: <info>  [1533709888.4588] dhcp6 (wlp2s0):   preferred_lft 4294967295
Aug 08 14:31:28 machine1 NetworkManager[904]: <info>  [1533709888.4589] dhcp6 (wlp2s0):   address fd89:9bdb:a20f::ba9
Aug 08 14:31:28 machine1 NetworkManager[904]: <info>  [1533709888.4591] dhcp6 (wlp2s0):   nameserver 'fd89:9bdb:a20f::1'
Aug 08 14:31:28 machine1 NetworkManager[904]: <info>  [1533709888.4593] dhcp6 (wlp2s0): state changed unknown -> bound, event ID="d4:9f:2f:5d|1533709888"
Aug 08 14:31:28 machine1 nm-dispatcher[20435]: req:5 'dhcp6-change' [wlp2s0]: new request (1 scripts)
Aug 08 14:31:28 machine1 nm-dispatcher[20435]: req:5 'dhcp6-change' [wlp2s0]: start running ordered scripts...
Aug 08 14:31:29 machine1 avahi-daemon[885]: Registering new address record for fd89:9bdb:a20f::ba9 on wlp2s0.*.

Hi everybody. Is there any news on this issue?

I am experiencing the same behavior reported: screen doesn't lock on resume if I "Suspend" from either the Menu "Suspend" Button or typing in the shell:

sudo systemctl suspend

However it does lock if I suspend my laptop with the power button.

How can I check which command is called when the power button is pressed?
In principle if one could replace the command run when clicking "Suspend" in the menu to the one that is run when clicking on the Power Button the issue would be fixed no?

Can anybody help me with this?

Cheers,
Luca

I found a work around this problem which works when suspending via:

  • command line
  • closing the laptop lid
  • suspend via indicator app or mate-menu

The work around is to install xss-lock and add it two the start applications:

xss-lock -- mate-screensaver-command --lock
3 Likes

Thank you @oz123. Your solution is the simplest one and it works for me on 20.04.