Bug 15970 - log file option in conf file not fully adhered, some hardcoded filenames seems be present
Summary: log file option in conf file not fully adhered, some hardcoded filenames seem...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.22.6
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-14 12:37 UTC by peter
Modified: 2026-01-14 12:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description peter 2026-01-14 12:37:58 UTC
In smb.conf there is the option to specify log file name:
# This tells Samba to use a separate log file for each machine
# that connects 
   log file = /var/log/samba/%m.log

The default is log.%m

When using logrotate to manage logfile aging it is difficult to deal with the default name scheme, so I changed it to %m.log

There still seem to be hardcoded log.%m being used by smbd and/or nmbd as I now have a mix of  the default filename scheme and the new one I setup:
ls  -l /var/log/samba shows:
total 32
-rw-r--r--  1 root root  282 Jan  9 17:23 192.168.XX.XX.log
-rw-r--r--  1 root root  564 Jan  9 18:20 192.168.XX.YY.log
-rw-r--r--  1 root root    0 Jan  9 17:50 2a05_XXXX_XXXX_XXXX_683d_XXXX_XXXX_XXXX.log
-rw-r--r--  1 root root    0 Jan  9 17:48 2a05_XXXX_XXXX_XXXX_683d_XXXX_XXXX_YYYYlog
drwx------ 10 root root 4096 Nov 22 18:20 cores
-rw-r--r--  1 root root  564 Jan  9 17:23 log.192.168.XX.XX
-rw-r--r--  1 root root  180 Jan  9 17:38 log.nmbd
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_classic
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_epmapper
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_fsrvp
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_lsad
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_mdssvc
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_spoolss
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_winreg
-rw-r--r--  1 root root    0 Jan  9 17:23 log.rpcd_witness
-rw-r--r--  1 root root    0 Jan  9 17:23 log.samba-dcerpcd
-rw-r--r--  1 root root    0 Jan  9 17:38 log.smbd
-rw-r--r--  1 root root  195 Jan  9 18:20 mac-XXXX.log
-rw-r--r--  1 root root    0 Jan  9 17:23 mac.log
-rw-r--r--  1 root root    0 Jan  9 17:19 mancavemini-3.log
-rw-r--r--  1 root root  421 Jan  9 17:41 nmbd.log
-rw-r--r--  1 root root 1347 Jan  9 17:38 smbd.log