samba does not listen on specified address after reboot in DebianApplying the following patch (copied from the same file in Ubuntu 18.10) to /etc/dhcp/dhclient-enter-hooks.d/samba solved the problem:
--- ./samba         2019-01-01 00:00:00.000000000 +0800
+++ ./samba.patched 2019-01-01 00:00:00.000000000 +0800
@@ -68,7 +68,18 @@
    # reload the samba server
    # We don't necessarily have the samba package installed. #414841
-   [ ! -x /etc/init.d/smbd ] || /usr/sbin/invoke-rc.d smbd reload
+   if [ -x /etc/init.d/smbd ]
+   then
+       if [ -d /run/systemd/system ]
+       then
+           if systemctl is-enabled smbd.service --quiet
+           then
+               systemctl try-reload-or-restart smbd.service
+           fi
+       else
+           /usr/sbin/invoke-rc.d smbd reload
+       fi
+   fi
 }
Applying the following patch (copied from the same file in Ubuntu 18.10) to /etc/dhcp/dhclient-enter-hooks.d/samba solved the problem:
--- ./samba         2019-01-01 00:00:00.000000000 +0800
+++ ./samba.patched 2019-01-01 00:00:00.000000000 +0800
@@ -68,7 +68,18 @@
    # reload the samba server
    # We don't necessarily have the samba package installed. #414841
-   [ ! -x /etc/init.d/smbd ] || /usr/sbin/invoke-rc.d smbd reload
+   if [ -x /etc/init.d/smbd ]
+   then
+       if [ -d /run/systemd/system ]
+       then
+           if systemctl is-enabled smbd.service --quiet
+           then
+               systemctl try-reload-or-restart smbd.service
+           fi
+       else
+           /usr/sbin/invoke-rc.d smbd reload
+       fi
+   fi
 }