From d2222d49477e44ed4863a8e3ad120f46c170100c Mon Sep 17 00:00:00 2001 From: Joshua King Date: Fri, 5 Jun 2026 11:45:07 -0400 Subject: [PATCH] setup-pi: default service user to invoking sudo user, not "pi" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The service unit hard-defaulted to User=pi, but not every Pi has a 'pi' user (e.g. this hub uses 'overseer') — systemd then fails with 217/USER. Default SERVICE_USER to ${SUDO_USER:-pi} so the service + /opt/remoterig ownership match the actual operator. Override with --service-user. Co-Authored-By: Claude Opus 4.8 --- scripts/setup-pi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup-pi.sh b/scripts/setup-pi.sh index d43395d..826f0e5 100755 --- a/scripts/setup-pi.sh +++ b/scripts/setup-pi.sh @@ -8,7 +8,7 @@ # # Options: # --config PATH Path to config.yaml template to copy to /opt/remoterig/ -# --service-user USER Systemd service user (default: pi) +# --service-user USER Systemd service user (default: invoking sudo user, else pi) # --static-ip IP Static IP for wlan0 (default: 192.168.8.56/24) # --gateway IP Gateway for wlan0 (default: 192.168.8.1) # --help Show this help @@ -19,7 +19,7 @@ set -euo pipefail # Defaults # --------------------------------------------------------------------------- CONFIG_TEMPLATE="" -SERVICE_USER="pi" +SERVICE_USER="${SUDO_USER:-pi}" # default to the invoking user (not every Pi has a 'pi' user) STATIC_IP="192.168.8.56/24" GATEWAY="192.168.8.1" MOSQUITTO_PKG="mosquitto mosquitto-clients"