samba4: fix netbios_name
authorAndy Walsh <redacted>
Thu, 27 Sep 2018 14:54:06 +0000 (16:54 +0200)
committerAndy Walsh <redacted>
Thu, 27 Sep 2018 15:03:28 +0000 (17:03 +0200)
* fixes: error 0x80070035
* add triggers to catch hostname changes

Signed-off-by: Andy Walsh <redacted>
net/samba4/Makefile
net/samba4/files/samba.config
net/samba4/files/samba.init

index 81d6b8fa971001359179bb426ef543c5487b4e27..c19797b9bebcf8c3ee096a9552ecda533a977ca5 100644 (file)
@@ -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 <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-3.0-only
index 1d62dcab7814adcc5c6da3ba18083193587e6b39..332bb27914ecc4f7337e7d329edcf47e874f0570 100644 (file)
@@ -1,5 +1,4 @@
 config samba
-       option 'name'                   'OpenWrt-SMB'
        option 'workgroup'              'WORKGROUP'
        option 'description'    'Samba on OpenWrt'
        option 'charset'                'UTF-8'
index 6462a32e27678968d66ab997b9765e4b9723a857..beafd99626235eb0abfdeee218b211c637190448 100644 (file)
@@ -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
git clone https://git.99rst.org/PROJECT