From c9cba619898d7bf87fc8277e57b473923d912c32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 10 Aug 2022 14:23:40 +0200 Subject: [PATCH] ksmbd-tools: append config from /var/run/config/ for runtime shares MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Dynamically created shares shouldn't be stored in the /etc/config/ because of: 1. Flash wearing 2. Risk of inconsistent state on reboots With this change all automation/hotplug.d scripts can store runtime in the /var/run/config/samba. It's useful e.g. for USB drives that user wants to be automatically shared. Also: automated scripts should never call "uci [foo] commit" as that could flush incomplete config. This problem also gets solved. Identical feature was added to samba36 in the OpenWrt commit 5a59e2c059866 ("samba36: append config from /var/run/config/ for runtime shares") but wasn't ported to ksmbd until now. Cc: Jo-Philipp Wich Signed-off-by: Rafał Miłecki --- net/ksmbd-tools/files/ksmbd.init | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ksmbd-tools/files/ksmbd.init b/net/ksmbd-tools/files/ksmbd.init index 7c628e826d..8758ed4ec2 100644 --- a/net/ksmbd-tools/files/ksmbd.init +++ b/net/ksmbd-tools/files/ksmbd.init @@ -116,6 +116,7 @@ init_config() mkdir -p /var/etc/ksmbd config_load ksmbd + CONFIG_APPEND=1 UCI_CONFIG_DIR=/var/run/config config_load ksmbd config_foreach smb_header globals config_foreach smb_add_share share } -- 2.30.2