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:
123456789101112131415161718192021 --- ./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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | --- ./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 } |