Back to Engineering Blog
Infrastructure & Reliability 3 min read

Power-On After AC Loss on a Mac Mini Running Debian Is a PCI Register

After a fleet shutdown drill, two Mac mini backup servers powered themselves on when AC returned. Apple's firmware does not expose that setting to Linux. The documented mechanism is one bit in the LPC controller's PCI config space, which resets every boot.

Jason NevillBy , Houston, TX
#MacMini#Linux#setpci#Power

Key Architectural Takeaways

  • Apple EFI does not expose power-on after AC loss to a non-macOS OS; on Intel 8-series Macs it is a bit in LPC config space.
  • PCI config space does not survive a power cycle, so persist the write with a boot-time unit that reads it back and asserts.
  • Applied and verified live is not the same as proven across a power cycle; say which one you have.

The challenge

During the third real fleet-shutdown drill, we noticed that two backup servers, both Mac minis (Macmini7,1) running Debian, powered themselves back on when AC power returned. For a backup server that is better turned off after an outage, until a person has checked the lab. One other host, a DNS node, was left as is for role reasons. We were asked to fix the first backup server, then to verify and fix the second, which shares the hardware.

Why the usual answers do not exist

This is not a PC server BIOS toggle. Apple's EFI firmware does not expose "power on after AC loss" to a non-macOS operating system. There is no pmset and no nvram equivalent, and we confirmed on both machines that neither exists.

The mechanism

Two independent sources (live research, not training-data memory) agree: bit 0 of PCI config register `0xa4` on the Intel 8-series LPC controller (00:1f.0). Zero means auto power-on after AC loss and one means stay off.

We checked it on the first machine: the register read 0x08, matching the observed behaviour. A masked write, setpci -s 0:1f.0 0xa4.B=01:01, touches only bit 0 and took it to 0x09. On the second machine we asked whether it behaved the same rather than assuming. It did: identical 0x08 before, 0x09 after.

Making it stick

This is PCI config space, not NVRAM, so the setting does not survive a power cycle by itself. A role applies it at every boot through a systemd oneshot and self-verifies: it reads the register back and asserts the value, instead of trusting setpci's exit code. The role began as a single-host role and was renamed when the second machine turned out to share the trait. A leftover service from the pre-rename deploy was found and removed.

A git mistake caught by a habit

The first commit of the rename and extension captured file renames with zero content diff, because a pathspec naming an already-moved path silently failed to stage the content edits. We caught it by running git show --stat straight after committing, amended, re-added the real paths and force-pushed with --force-with-lease on our own branch. Check what a commit captured.

What is not proven

Both machines were verified live, but neither had been through a real power cycle with the fix in place. The commitment recorded was to confirm it on the next real drill.

Takeaway

When the vendor firmware hides a setting, look for the hardware register behind it, apply the smallest masked write, and make the persistence verify itself.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.