This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

/etc/rc.d/samba ignores samba_logdir variable

CIFS/SMB network sharing.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
derailleur
NewUser
NewUser
Posts: 9
Joined: 15 May 2015 03:44
Status: Offline

/etc/rc.d/samba ignores samba_logdir variable

Post by derailleur »

Running embedded 10.2.0.2-2223, I've embarked on a mission to move my log files to a physical drive as a learning exercise for myself. I discovered that even if samba_logdir is set in rc.conf, although it will create the directory at the location specified, smbd.log and nmbd.log are created in /var/log/samba4 regardless. Going by the man page, it appears to me that the /var/log/samba4 location was likely compiled into smbd and nmbd. The logfile location can be over-ridden with the -l=logdirectory command.

I realize I can override the nmdb_flags and smdb_flags from rc.conf, but then there is no point in having the samba_logdir variable.

Fortunately, there is a simple fix, in /etc/rc.c/samba replace

Code: Select all

nmbd_flags="${nmbd_flags=\"-D\"}"
smbd_flags="${nmbd_flags=\"-D\"}"
with

Code: Select all

nmbd_flags="${nmbd_flags=\"-l=${samba_logdir}\"}"
smbd_flags="${nmbd_flags=\"-l=${samba_logdir}\"}"
Alternately, it could be done down where the [global] section of smb.conf is created, but this seemed "easier" to me. :D

Post Reply

Return to “CIFS/SMB (Samba)”