From 696c2b6096f78fb74d8fb5a5514cc9d653795840 Mon Sep 17 00:00:00 2001 From: Wesley Gimenes Date: Tue, 17 Feb 2026 04:04:06 -0300 Subject: [PATCH] netbird: move state file to reduce storage wear Add `NB_DNS_STATE_FILE="/var/lib/netbird/state.json"` to the init environment. This moves the state from the directory `/root/.config/netbird` to the file `/var/lib/netbird/state.json` to avoid storage wear. Note: the file is not preserved across reboots. The state file contains information such as locally disabled routes and other data primarily useful for desktop clients. In OpenWrt setups, these changes are normally handled by the NetBird `management` server. This matches the behavior prior to `netbird` v0.52.x, I have not received any reports that this file caused problems before, so it is unlikely to cause issues now. The previous state file `/root/.config/netbird/state.json` can be removed. Signed-off-by: Wesley Gimenes --- net/netbird/Makefile | 2 +- net/netbird/files/netbird.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netbird/Makefile b/net/netbird/Makefile index d349b525d2..29d95a4d6b 100644 --- a/net/netbird/Makefile +++ b/net/netbird/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netbird PKG_VERSION:=0.60.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/netbirdio/netbird/tar.gz/v$(PKG_VERSION)? diff --git a/net/netbird/files/netbird.init b/net/netbird/files/netbird.init index 6072e2d2c3..533404a075 100755 --- a/net/netbird/files/netbird.init +++ b/net/netbird/files/netbird.init @@ -12,6 +12,7 @@ start_service() { procd_set_param env NB_STATE_DIR="/root/.config/netbird" procd_append_param env NB_DISABLE_SSH_CONFIG="1" + procd_append_param env NB_DNS_STATE_FILE="/var/lib/netbird/state.json" procd_set_param pidfile /var/run/netbird.pid procd_close_instance