samba: tries to put some logs under /usr/local/samba/var/
While trying to debug samba, I've found out that it tries to use a weird directory for logs by default; The main log file goes under /var/log/samba/log.smbd
, but the only logged thing of note is that it can't open a file inside /usr/local/samba/var/
; relevant log snippet:
[2022/02/01 15:00:05, 0] ../../lib/util/util.c:212(directory_create_or_exist)
directory_create_or_exist: mkdir failed on directory /usr/local/samba/var/cores: No such file or directory
[2022/02/01 15:00:05, 0] ../../source3/lib/dumpcore.c:59(get_default_corepath)
Failed to create /usr/local/samba/var/cores for user 0 with mode 0700
[2022/02/01 15:00:05, 0] ../../source3/lib/dumpcore.c:256(dump_core_setup)
Unable to setup corepath for smbd: No such file or directory
[2022/02/01 15:00:05.479098, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.smbd': No such file or directory
[2022/02/01 15:00:05.479290, 0] ../../source3/smbd/server.c:1738(main)
smbd version 4.15.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2021
[2022/02/01 15:00:05.479772, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.smbd': No such file or directory
[2022/02/01 15:00:05.480204, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.smbd': No such file or directory
[2022/02/01 15:00:05.480281, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.smbd': No such file or directory
[2022/02/01 15:00:05.490174, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.smbd': No such file or directory
[2022/02/01 15:00:22.657553, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.192.168.250.98': No such file or directory
[2022/02/01 15:00:22.657753, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.amanda': No such file or directory
[2022/02/01 15:00:22.657831, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.amanda': No such file or directory
[2022/02/01 15:00:22.658493, 0] ../../lib/util/debug.c:1098(reopen_one_log)
reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.192.168.250.98': No such file or directory
[2022/02/01 15:00:22.658766, 0] ../../lib/util/debug.c:1098(reopen_one_log)
I think that the package isn't configured properly, per aports rules packages shouldn't use the /*/local/
directories.
Excerpt from default smb.conf:
# this tells Samba to use a separate log file for each machine
# that connects
log file = /usr/local/samba/var/log.%m