From 32328835dfffed82cf286a5b76d783462aef450f Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Thu, 27 Sep 2018 16:54:06 +0200 Subject: [PATCH] samba4: fix netbios_name * fixes: error 0x80070035 * add triggers to catch hostname changes Signed-off-by: Andy Walsh --- net/samba4/Makefile | 2 +- net/samba4/files/samba.config | 1 - net/samba4/files/samba.init | 29 +++++++++++------------------ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/net/samba4/Makefile b/net/samba4/Makefile index 81d6b8fa97..c19797b9be 100644 --- a/net/samba4/Makefile +++ b/net/samba4/Makefile @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=4.9.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Andy Walsh PKG_LICENSE:=GPL-3.0-only diff --git a/net/samba4/files/samba.config b/net/samba4/files/samba.config index 1d62dcab78..332bb27914 100644 --- a/net/samba4/files/samba.config +++ b/net/samba4/files/samba.config @@ -1,5 +1,4 @@ config samba - option 'name' 'OpenWrt-SMB' option 'workgroup' 'WORKGROUP' option 'description' 'Samba on OpenWrt' option 'charset' 'UTF-8' diff --git a/net/samba4/files/samba.init b/net/samba4/files/samba.init index 6462a32e27..beafd99626 100644 --- a/net/samba4/files/samba.init +++ b/net/samba4/files/samba.init @@ -1,6 +1,6 @@ #!/bin/sh /etc/rc.common -START=99 +START=98 USE_PROCD=1 smb_header() { @@ -19,12 +19,12 @@ smb_header() { done ) - local name workgroup description charset - local hostname="$(uci_get system.@system[0].hostname)" + local workgroup description charset + # we dont use netbios anymore as default and wsd/avahi is dns based + local hostname="$(hostname -f)" - config_get name $1 name "${hostname:-OpenWrt}" - config_get workgroup $1 workgroup "${hostname:-WORKGROUP}" - config_get description $1 description "Samba on ${hostname:-OpenWrt}" + config_get workgroup $1 workgroup "WORKGROUP" + config_get description $1 description "Samba on OpenWrt" config_get charset $1 charset "UTF-8" config_get_bool MACOS $1 macos 0 @@ -33,7 +33,7 @@ smb_header() { config_get_bool DISABLE_WINBIND $1 disable_winbind 0 mkdir -p /var/etc - sed -e "s#|NAME|#$name#g" \ + sed -e "s#|NAME|#$hostname#g" \ -e "s#|WORKGROUP|#$workgroup#g" \ -e "s#|DESCRIPTION|#$description#g" \ -e "s#|INTERFACES|#$interfaces#g" \ @@ -144,18 +144,11 @@ init_config() { config_foreach smb_add_share sambashare } -reload_service() { - init_config - - killall -HUP samba - killall -HUP smbd - killall -HUP nmbd - killall -HUP winbindd -} - service_triggers() { - procd_add_reload_trigger samba4 - + PROCD_RELOAD_DELAY=2000 + + procd_add_reload_trigger "dhcp" "system" "samba4" + local i for i in $samba_iface; do procd_add_reload_interface_trigger $i -- 2.30.2