Community Solution

Stop a Laptop Running ZimaOS from Sleeping When the Lid Closes: HandleLidSwitch=ignore

An August 2025 HP ProBook 450 G7 thread where closing the lid suspended ZimaOS 1.4.2. A community reply suggested systemd logind configuration, Zima-Giorgio linked an earlier IceWhale thread about editable systemd files, and the original poster confirmed that HandleLidSwitch=ignore plus reboot solved the problem.

The source fix is clear and user-verified: on an HP ProBook 450 G7 running ZimaOS 1.4.2, closing the lid suspended the whole NAS. Editing systemd-logind so HandleLidSwitch=ignore and rebooting stopped the automatic suspend. The original poster explicitly confirmed the change worked.

This is useful for laptop-based homelabs because a NAS is usually expected to stay online with the lid closed. It is still a host-level power-policy change, so record the original setting and keep a recovery method before editing it.

The Laptop Suspended and Resumed Normally with the Lid

The source behavior was reproducible:

  • close lid → system sleeps;
  • open lid → system resumes.

That points to systemd-logind/ACPI lid handling rather than a ZimaOS crash.

The First Suggestion Came from Standard systemd Behavior

A community reply suggested editing:

/etc/systemd/logind.conf

and changing the lid-switch action. The commenter correctly noted they were adapting an Ubuntu/systemd solution and were not initially sure how ZimaOS handled the file.

IceWhale Had Previously Made systemd Files Editable for This Use Case

Zima-Giorgio linked an earlier IceWhale thread where a laptop user had the same requirement. In that older thread, Giorgio said ZimaOS would make files in the systemd folder editable starting with v1.2.3.

That gives the source fix more support than an arbitrary attempt to modify a normally read-only system path.

The Source-Confirmed Setting Was HandleLidSwitch=ignore

The original poster changed:

#HandleLidSwitch=suspend

to:

HandleLidSwitch=ignore

They then rebooted and confirmed lid-close no longer suspended the server.

Back Up the Original Configuration

Before editing a host power-management file, copy or record the original line. If the laptop later behaves unexpectedly, you should be able to restore the prior setting from a local console or SSH session.

Understand Related Lid-Switch Settings

systemd-logind can distinguish normal lid close, external power, and docked operation. The source only changed HandleLidSwitch. Do not uncomment every related option unless you need different policies for battery, AC power, or docking.

A Laptop NAS Still Needs a Battery/Power Plan

Ignoring the lid does not prevent battery drain. For an always-on laptop server, keep reliable AC power, monitor battery health/temperature, and decide what should happen during a real power outage.

Ignoring the Lid Is Not the Same as Turning Off the Display

You can keep the OS running while the built-in display is unused. Do not assume the lid setting must control screen blanking, VM display, or local console access.

Retest After Major ZimaOS Updates

The source was on 1.4.2, while current ZimaOS is 1.7.1. If a major update replaces or changes the effective logind configuration, verify the lid behavior again rather than assuming the old file is still active.

Laptop Lid FAQ

Did HandleLidSwitch=ignore work for the source user?

Yes. They explicitly confirmed it after reboot.

Is this a Docker setting?

No. It is a host systemd-logind power-management setting.

Should a laptop NAS always ignore lid close?

Only if that matches the intended always-on behavior. Some users may prefer suspend on battery or during travel.