Community Solution

Stop ZimaOS Laptop Sleep on Lid Close

A community reply suggested changing systemd-logind lid-switch behavior when a laptop running ZimaOS suspends after the lid is closed.

Why Closing a Laptop Lid Can Suspend ZimaOS

A laptop repurposed as a ZimaOS server can still inherit laptop power-management behavior. The community reply suggested editing systemd-logind settings because the lid switch normally triggers suspend on many Linux systems. That guidance is directionally correct, but the specific line in the old reply should not be copied without understanding the desired value.

If the main goal is a permanently available home server, compare the trade-offs of repurposed hardware with a dedicated always-on platform such as ZimaBoard 2 or ZimaBlade.

The Important systemd Setting

The upstream systemd documentation defines HandleLidSwitch= and notes that the default action is commonly suspend. To keep a closed-lid server running, the intended value is typically ignore, not suspend. Review the current systemd logind.conf documentation before editing the host.

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore

Exact option availability depends on the systemd version. ZimaOS is an appliance-style system, so any host-level edit should be treated as an advanced change that may behave differently across updates.

Check BIOS or Firmware First

Some laptops expose lid, sleep, AC-power or power-on behavior in firmware. If the hardware can ignore lid-close events there, that can be cleaner than modifying the operating system. Also confirm that closing the lid does not block required cooling vents.

Apply Changes Carefully

  1. Connect over SSH or have local console access before changing power behavior.
  2. Back up the existing logind configuration.
  3. Set the lid-switch action to ignore only if you intentionally want the machine to remain on.
  4. Restart the relevant service or reboot during a maintenance window.
  5. Close the lid and confirm the server remains reachable, storage stays mounted and temperatures remain safe.

The current ArchWiki power management guide is useful background for distinguishing firmware, kernel and systemd power actions.

Do Not Ignore Thermal Design

A laptop designed to run open may use the keyboard deck or hinge area for airflow. A closed-lid server should be checked under sustained CPU, disk and network load. If temperatures rise sharply or the fan path is obstructed, keep the lid open or change the physical deployment.

FAQ

Should HandleLidSwitch be set to suspend?

No if the goal is to prevent sleep. suspend tells systemd to suspend on lid close; ignore is the relevant action for keeping the system running.

Will this survive every ZimaOS update?

Do not assume it will. Host-level configuration can be reset or behave differently across appliance OS updates, so document the change and re-check it after major upgrades.

Is disabling lid sleep always safe?

No. Verify cooling, battery condition and physical placement before using a laptop as a closed-lid always-on server.