Skip to content

UPS shutdown orchestration (Synology NUT server → Mac Mini clients)

Status

Active for clean shutdown on outage. Auto-boot after AC returns on both Ubuntu Mac minis via setpci + auto-reboot-on-power.service.

Objective

Use one UPS (CyberPower CP1500AVRLCD) to shut down homelab hosts during extended outages:

  • Leviathon (Synology DS216+II — UPS cable host)
  • Seamoth (Macmini6,1 — NUT client)
  • Prawn (Macmini5,1 — NUT client)

Environment

Component Value
UPS model CyberPower CP1500AVRLCD
UPS physical link Serial to Synology NAS
DSM version DSM 7.1.1-42962 Update 9
NUT topology Synology as NUT server; Mac minis as NUT clients (upsmon slave)

Host layout: projects/Homelab-Mac-Mini-Hosts.

Final architecture

  1. UPS is physically attached to Leviathon.
  2. Synology runs built-in UPS support and exposes a network UPS server (NUT-compatible).
  3. Seamoth and Prawn run NUT clients and upsmon.
  4. On battery/low-battery events, each Mac mini receives status over LAN and shuts down gracefully.
  5. After utility power returns, each Mac mini applies auto power-on when AC is restored at boot via setpci.

Synology configuration

DSM path: Control Panel → Hardware & Power → UPS

  • Enabled local UPS support.
  • Enabled network UPS server.
  • Permitted devices: include 10.0.0.20 (Seamoth) and 10.0.0.21 (Prawn).
  • Firewall: TCP 3493 from both Mac minis (LAN allow rule on Leviathon usually covers 10.0.0.0/24).
  • Client credentials: SSH → /usr/syno/etc/ups/upsd.users for MONITOR lines on each client.

Seamoth (Macmini6,1 — 10.0.0.20)

NUT install apt — nut-client, nut-monitor systemd unit
Config /etc/nut/nut.conf → MODE=netclient; /etc/nut/upsmon.conf → MONITOR [email protected] 1 <user> <pass> slave
Shutdown SHUTDOWNCMD "/sbin/shutdown -h now"
Auto-boot setpci -s 0:1f.0 0xa4.b=0 via auto-reboot-on-power.service — verify LPC with lspci on Macmini6,1 (HM77; same 0:1f.0 pattern as older mini in practice)
Deps pciutils
sudo apt install -y nut-client pciutils
sudo systemctl enable --now nut-monitor
upsc [email protected]

Prawn (Macmini5,1 — 10.0.0.21)

NUT install Linuxbrew — brew install nut; brew services start nut
Config /home/linuxbrew/.linuxbrew/etc/nut/ — MODE=netclient; same MONITOR [email protected] pattern
Service label homebrew.nut (not homebrew.mxcl.nut)
Debug sudo /home/linuxbrew/.linuxbrew/sbin/upsmon -FDD
Auto-boot setpci -s 0:1f.0 0xa4.b=0 + auto-reboot-on-power.service — documented for HM65 LPC on Macmini5,1

Auto-boot after power failure (both hosts)

Wake-on-LAN is not used for recovery from full shutdown. setpci writes LPC register 0xa4 (byte 0) on each boot.

systemd unit (same on both): /etc/systemd/system/auto-reboot-on-power.service

[Unit]
Description=Enable auto-boot after power failure
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/setpci -s 0:1f.0 0xa4.b=0
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now auto-reboot-on-power.service

Confirm with a controlled test: clean shutdown → brief AC disconnect → reconnect → host powers on without the front button.

Notes and gotchas

  • Two clients: both Mac minis must appear in DSM permitted devices for the network UPS server.
  • Prawn / Linuxbrew: sudo upsmon may need the full path under .linuxbrew/sbin/.
  • Seamoth / apt: use systemctl status nut-monitor after reboot.

Verification checklist

  • NAS UPS support + network UPS server enabled
  • Seamoth and Prawn LAN IPs permitted on NAS UPS server
  • NAS firewall allows TCP 3493 from Mac minis
  • NUT client on Seamoth (apt) and Prawn (Linuxbrew)
  • upsmon slave → [email protected]
  • auto-reboot-on-power.service on both hosts