summaryrefslogtreecommitdiff
path: root/package/network/services
diff options
context:
space:
mode:
authorConn O'Griofa <connogriofa@gmail.com>2016-08-04 01:31:50 +0100
committerJohn Crispin <john@phrozen.org>2016-08-15 15:18:35 +0200
commit63f6fc5c16996cc47369bb0d6ef28ccd39845e7b (patch)
tree10b13e56ee8aff33abc6db53a09e6029c5ea2e17 /package/network/services
parentd1b20a36590b185a649d2b4c040d81e506224487 (diff)
downloadmtk-20170518-63f6fc5c16996cc47369bb0d6ef28ccd39845e7b.zip
mtk-20170518-63f6fc5c16996cc47369bb0d6ef28ccd39845e7b.tar.gz
mtk-20170518-63f6fc5c16996cc47369bb0d6ef28ccd39845e7b.tar.bz2
samba: add file/interface reload triggers & filter interfaces
* Only parse interfaces that are up during init_config (as the script depends on this to determine the proper IP/subnet range) * Add reload interface triggers for samba-designated interfaces * Force full service restart upon config change to ensure Samba binds to new interfaces (sending HUP signal doesn't work) * Rename "interface" variable to "samba_iface" and move into global scope Needed to fix Samba connectivity for clients connecting from a different LAN subnet (e.g. pseudobridge configurations) due to the 'bind interfaces only' setting. Signed-off-by: Conn O'Griofa <connogriofa@gmail.com>
Diffstat (limited to 'package/network/services')
-rwxr-xr-xpackage/network/services/samba36/files/samba.init19
1 files changed, 10 insertions, 9 deletions
diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init
index bc1dbf8..c841324 100755
--- a/package/network/services/samba36/files/samba.init
+++ b/package/network/services/samba36/files/samba.init
@@ -5,16 +5,16 @@ START=60
USE_PROCD=1
smb_header() {
- local interface
- config_get interface $1 interface "loopback lan"
+ config_get samba_iface $1 interface "loopback lan"
# resolve interfaces
local interfaces=$(
. /lib/functions/network.sh
local net
- for net in $interface; do
+ for net in $samba_iface; do
local device
+ network_is_up $net || continue
network_get_device device "$net" && {
local subnet
network_get_subnet subnet "$net" && echo -n "$subnet "
@@ -93,14 +93,13 @@ init_config() {
config_foreach smb_add_share sambashare
}
-reload_service() {
- init_config
-
- killall -HUP smbd
-}
-
service_triggers() {
procd_add_reload_trigger samba
+
+ local i
+ for i in $samba_iface; do
+ procd_add_reload_interface_trigger $i
+ done
}
start_service() {
@@ -109,10 +108,12 @@ start_service() {
procd_open_instance
procd_set_param command /usr/sbin/smbd -F
procd_set_param respawn
+ procd_set_param file /var/etc/smb.conf
procd_close_instance
procd_open_instance
procd_set_param command /usr/sbin/nmbd -F
procd_set_param respawn
+ procd_set_param file /var/etc/smb.conf
procd_close_instance
}