Skip to content

Commit

Permalink
ksmbd-tools: append config from /var/run/config/ for runtime shares
Browse files Browse the repository at this point in the history
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
5a59e2c ("samba36: append config from /var/run/config/ for runtime
shares") but wasn't ported to ksmbd until now.

Cc: Jo-Philipp Wich <[email protected]>
Signed-off-by: Rafał Miłecki <[email protected]>
  • Loading branch information
Rafał Miłecki authored and neheb committed Aug 11, 2022
1 parent 5a2fa10 commit c9cba61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ksmbd-tools/files/ksmbd.init
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c9cba61

Please sign in to comment.