smb.conf resetting after services restart?

SMB, NFS, AFP, FTP, web file manager and Rsync server.
Locked
User avatar
matt_30
Posts: 67
Joined: 02 Jan 2021, 23:22

smb.conf resetting after services restart?

Post by matt_30 »

Hi,

I am trying to add a line into smb.conf however whenever i restart samba services the smb.conf file appears to revert itself.

Is there any way to disable this behaviour?
User avatar
DiscoSi
Posts: 36
Joined: 09 Apr 2020, 20:21

Re: smb.conf resetting after services restart?

Post by DiscoSi »

smb.conf is created on service start as you've found. It does include at the top another file which I believe remains static

Code: Select all

/etc/samba/smb-extend.conf
Try adding your line to this file and see if that works. The only danger is that the rest of the smb.conf file could override your setting, or future updates will likely overwrite smb-extend.conf
F5-221 TOS 4.2.09 4x4TB Seagate Ironwolf, 1x240GB Ironwolf SSD (Cache)
User avatar
matt_30
Posts: 67
Joined: 02 Jan 2021, 23:22

Re: smb.conf resetting after services restart?

Post by matt_30 »

Sadly it looks like that file is rewritted too

I added 2 coment lines in to test:

Code: Select all

[root@TNAS-7702 samba]# tail smb-extend.conf
full_audit:syslog = true
full_audit:prefix = %u|%I
full_audit:success = connect mkdir rmdir pread_send pread_recv create_file read pread write pwrite sendfile rename unlink symlink link
full_audit:failure = connect
security = user
include = /etc/samba/smb-null.conf

#
#

[root@TNAS-7702 samba]# /etc/init.d/samba restart
Reloading smb.conf file: 0
0
[root@TNAS-7702 samba]# tail smb-extend.conf
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/Network Trash Folder/Temporary Items/
hide files = /~$*.doc?/~$*.xls?/~$*.ppt?
vfs objects = full_audit catia fruit streams_xattr
fruit:aapl = yes
full_audit:syslog = true
full_audit:prefix = %u|%I
full_audit:success = connect mkdir rmdir pread_send pread_recv create_file read pread write pwrite sendfile rename unlink symlink link
full_audit:failure = connect
security = user
include = /etc/samba/smb-null.conf
[root@TNAS-7702 samba]#
User avatar
TMRyan
TerraMaster Team
Posts: 847
Joined: 01 Dec 2020, 11:50
China

Re: smb.conf resetting after services restart?

Post by TMRyan »

Hi,
I'm not sure what the consequences will be if you modify the configuration file.
If you want to try to add content, maybe you can try to use "chattr -i /path" to restore the file to read-write, and then use "chattr +i /path" to lock the file as read-only after the change.
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement)
Locked

Return to “File Services”