From 6781e50a271d64b4f5437c56d8b3a612ec129f5b Mon Sep 17 00:00:00 2001 From: Johan Date: Mon, 12 Jun 2023 08:44:13 +0200 Subject: [PATCH] Fix samba share file caching problem --- BashScripts/install-apache.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BashScripts/install-apache.sh b/BashScripts/install-apache.sh index e06dd4f..a82bfa5 100644 --- a/BashScripts/install-apache.sh +++ b/BashScripts/install-apache.sh @@ -29,6 +29,7 @@ then force create mode = 777 directory mask = 777 force directory mode = 777 + oplocks = yes [/$REALUSER-www] EOT fi @@ -49,6 +50,7 @@ EOT force group = root writeable = yes admin users = root + oplocks = yes [/www] EOT fi @@ -69,10 +71,16 @@ EOT force group = root writeable = yes admin users = root + oplocks = yes [/apache2] EOT fi sed -i -e 's/obey pam restrictions = yes/obey pam restrictions = no/g' /etc/samba/smb.conf + # https://www.oreilly.com/openbook/samba/book/ch05_05.html + # https://unix.stackexchange.com/questions/425934/windows-clients-will-not-refresh-linux-samba-file-locally-if-reading-file-at-int + # Add kernel oplocks = yes under [global] + sed -i '/kernel oplocks/d' /etc/samba/smb.conf + sed -i '/\[global\]/a kernel oplocks = yes' /etc/samba/smb.conf service smbd restart 2>>install.log && ufw allow samba 2>>install.log