From f8ef39e8c0a460f91a1ac4cdb007b95385abe7fd Mon Sep 17 00:00:00 2001 From: vidplace7 Date: Sun, 15 Jun 2025 09:21:22 -0400 Subject: [PATCH] Run as meshtasticd user (not root) --- meshtasticd/Makefile | 1 + meshtasticd/files/meshtasticd.init | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/meshtasticd/Makefile b/meshtasticd/Makefile index 8f51fc0..caaf2a1 100644 --- a/meshtasticd/Makefile +++ b/meshtasticd/Makefile @@ -37,6 +37,7 @@ define Package/meshtasticd/Default SUBMENU:=Meshtastic TITLE:=Meshtastic daemon URL:=https://github.com/meshtastic/firmware + USERID:=meshtasticd:meshtasticd endef # Leaving a possibility for adding a light variant without the web UI support if diff --git a/meshtasticd/files/meshtasticd.init b/meshtasticd/files/meshtasticd.init index 440a5f4..9b2c193 100644 --- a/meshtasticd/files/meshtasticd.init +++ b/meshtasticd/files/meshtasticd.init @@ -24,10 +24,14 @@ start_service() { mkdir -p "$data_dir" + chown -R meshtasticd:meshtasticd "$data_dir" + chown -R meshtasticd:meshtasticd "$config_dir" + # meshtasticd needs to be run from its data directory cd "$data_dir" procd_open_instance + procd_set_param user meshtasticd procd_set_param command "$PROG" procd_append_param command --fsdir="$data_dir" procd_set_param file "$config_file"