@Owlsun Hi, so for 1. Why have a monitor connected, any management can be done remotely? Is this a laptop based on your second question? I have a remote laptop, I use consoleblank grub option as I don’t need access.
For 2. edit /etc/systemd/logind.conf and uncomment the line HandleLidSwitch and change to ignore
Now the laptop stay awake when I close the lid but I get journalctl polluted with endless entries like:
Dec 23 22:46:32 msi systemd-logind[10191]: Suspending...
Dec 23 22:46:32 msi systemd-logind[10191]: Unit suspend.target is masked, refusing operation.
Dec 23 22:46:32 msi systemd-logind[10191]: Failed to execute suspend operation: Permission denied
I wasn’t been able to disable systemd-suspend.service
> sudo systemctl disable systemd-suspend
Unit /etc/systemd/system/systemd-suspend.service is masked, ignoring.
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled using systemctl.
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
instance name specified.
But I could mask it.
When I closed the lid the computer stayed awake but disconnected the network:
Dec 24 18:24:41 systemd-logind[1101]: Lid closed.
Dec 24 18:24:41 systemd-logind[1101]: Suspending...
Dec 24 18:24:41 ModemManager[1193]: <info> [sleep-monitor-systemd] system is about to suspend
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.7605] manager: sleep: sleep requested (sleeping: no enabled: yes)
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.7609] device (wlp2s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.7621] device (wlp2s0): set-hw-addr: reset MAC address to (unmanage)
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.7642] manager: NetworkManager state is now ASLEEP
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.7646] device (enp3s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
Dec 24 18:24:41 dbus-daemon[1081]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.5' (u>
Dec 24 18:24:41 systemd[1]: Starting Network Manager Script Dispatcher Service...
Dec 24 18:24:41 dbus-daemon[1081]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 24 18:24:41 systemd[1]: Started Network Manager Script Dispatcher Service.
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8249] device (enp3s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8276] dhcp4 (enp3s0): canceled DHCP transaction
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8277] dhcp4 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8277] dhcp4 (enp3s0): state changed no lease
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8279] dhcp6 (enp3s0): canceled DHCP transaction
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8280] dhcp6 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8280] dhcp6 (enp3s0): state changed no lease
Dec 24 18:24:41 NetworkManager[1202]: <info> [1703435081.8647] device (enp3s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Dec 24 18:24:41 kernel: r8169 0000:03:00.0 enp3s0: Link is Down