Launchd

Fixing doas: not installed setuid on macOS (MacPorts)

Date: 2026-02-08
Host: macOS (MacPorts prefix: /opt/local)
Component: doas (MacPorts)

My WireGuard client app failed to load profiles because the code path relies on doas for privilege escalation. This fix corrects the macOS (MacPorts) doas installation so the client can elevate properly.

doas: not installed setuid

…and exiting with status 1.


Root Cause

On macOS, MacPorts installs doas without the setuid bit by default.

Because doas is not setuid-root, it cannot elevate privileges. I depend on doas and rarely use sudo, so any command that relies on it fails immediately, including:

 …

Fixing a grafana instance on macOS

Date: 2026-02-08
Host: server (macOS Monterey; Homebrew prefix: /usr/local)
Grafana install: Homebrew (/usr/local/opt/grafana)
Grafana data: /usr/local/var/lib/grafana

Grafana (Homebrew on macOS Monterey) & Password Reset + Boot-Time Startup (No GUI Login)


Summary of the fix

  1. The admin password did not work, even after reset attempts.
  2. Grafana ran manually, but it did not run reliably as a user service through brew services. The service needed to start at boot without a desktop login.
  3. We fixed both problems:
  • Reset the password against the actual Brew paths and database that the running server uses.
  • Replace the GUI-bound LaunchAgent approach with a system LaunchDaemon at /Library/LaunchDaemons/... that runs at boot as your user.

Caveats

The password reset reported success but used the wrong database

You can point Grafana at different data directories. In this setup, the running Brew Grafana server uses:

 …