Fix samba share file caching problem
This commit is contained in:
parent
2c33ad6042
commit
6781e50a27
@ -29,6 +29,7 @@ then
|
|||||||
force create mode = 777
|
force create mode = 777
|
||||||
directory mask = 777
|
directory mask = 777
|
||||||
force directory mode = 777
|
force directory mode = 777
|
||||||
|
oplocks = yes
|
||||||
[/$REALUSER-www]
|
[/$REALUSER-www]
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
@ -49,6 +50,7 @@ EOT
|
|||||||
force group = root
|
force group = root
|
||||||
writeable = yes
|
writeable = yes
|
||||||
admin users = root
|
admin users = root
|
||||||
|
oplocks = yes
|
||||||
[/www]
|
[/www]
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
@ -69,10 +71,16 @@ EOT
|
|||||||
force group = root
|
force group = root
|
||||||
writeable = yes
|
writeable = yes
|
||||||
admin users = root
|
admin users = root
|
||||||
|
oplocks = yes
|
||||||
[/apache2]
|
[/apache2]
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
sed -i -e 's/obey pam restrictions = yes/obey pam restrictions = no/g' /etc/samba/smb.conf
|
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 &&
|
service smbd restart 2>>install.log &&
|
||||||
ufw allow samba 2>>install.log
|
ufw allow samba 2>>install.log
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user