Rowland Penny
2023-Jan-11 10:15 UTC
[Samba] [4.13.13-Debian] " reopen_one_log: Unable to open new log file '/var/log/samba/': Is a directory"?
On 11/01/2023 09:55, Michael Tokarev via samba wrote:> 11.01.2023 12:48, Gilles via samba wrote: > >> [2023/01/11 10:04:49.943723,? 0] >> ../../lib/util/debug.c:1104(reopen_one_log) >> reopen_one_log: Unable to open new log file '/var/log/samba/': Is a >> directory > >> smb.conf: log file = /var/log/samba/%m > > some daemons work without client information, ie, they're not > client-specific. > These will try to open log files too. Without client info, "%m" expands to > nothing, to an empty string. So you'll have the error message like that. > > Fix your log file setting. Check what's the default for this. > > /mjt > > >There isn't a default and '%m' is supposed to work. I think we need to see how the OP is running Samba, to do this, we need the output of 'testparm -s' or 'samba-tool testparm' if it is a DC (which it shouldn't be, because it looks like nmbd is running). Rowland
Michael Tokarev
2023-Jan-11 10:23 UTC
[Samba] [4.13.13-Debian] " reopen_one_log: Unable to open new log file '/var/log/samba/': Is a directory"?
11.01.2023 13:15, Rowland Penny via samba wrote:>>> smb.conf: log file = /var/log/samba/%m >> >> some daemons work without client information, ie, they're not client-specific. >> These will try to open log files too. Without client info, "%m" expands to >> nothing, to an empty string. So you'll have the error message like that. >> >> Fix your log file setting. Check what's the default for this. > > There isn't a default and '%m' is supposed to work. > > I think we need to see how the OP is running Samba, to do this, we need the output of 'testparm -s' or 'samba-tool testparm' if it is a DC (which it > shouldn't be, because it looks like nmbd is running).Sigh. Rowland, sometimes you're not helpful at all. Like in this case. Yes there's no default for "log file" parameter, - that's my bad, I remember seeing "/var/log/samba/log.%m" somewhere - it is not the default, it is the "example value" in man 5 smb.conf. As you wrote multiple times yourself, netbios is dead. %m is a netbios name of the client. And at the description of %m in man 5 smb.conf we can see: This parameter is not available when Samba listens on port 445, as clients no longer send this information. If you use this macro in an include statement on a domain that has a Samba domain controller be sure to set in the [global] section smb ports = 139. This will cause Samba to not listen on port 445 and will permit include functionality to function as it did with Samba 2.x. /var/log/samba/%m is *not* supposed to work, exactly the way it doesn't work in the OP case. The only thing needed for him is to fix the log file parameter as I suggested to fix the issue. Please stay a bit more focused. Thanks, /mjt
Gilles
2023-Jan-11 10:28 UTC
[Samba] [4.13.13-Debian] " reopen_one_log: Unable to open new log file '/var/log/samba/': Is a directory"?
On 11/01/2023 11:15, Rowland Penny via samba wrote:> Fix your log file setting. Check what's the default for this. > > There isn't a default and '%m' is supposed to work. > > I think we need to see how the OP is running Samba, to do this, we > need the output of 'testparm -s' or 'samba-tool testparm' if it is a > DC (which it shouldn't be, because it looks like nmbd is running).It's a stand-alone server. Here's the output from testparm -s: ============Load smb config files from /etc/samba/smb.conf Loaded services file OK. Weak crypto is allowed Server role: ROLE_STANDALONE # Global parameters [global] ??????? bind interfaces only = Yes ??????? disable netbios = Yes ??????? disable spoolss = Yes ??????? guest account = www-data ??????? interfaces = lo enp0s20 ??????? load printers = No ??????? log file = /var/log/samba/%m ??????? map to guest = Bad User ??????? netbios name = SAMBA ??????? printcap name = /dev/null ??????? server role = standalone server ??????? server string = Some great server ??????? show add printer wizard = No ??????? idmap config * : backend = tdb ??????? hosts allow = 127.0.0.1 192.168.0.0/24 ??????? hosts deny = 0.0.0.0/0 ??????? printing = bsd [guest] ??????? comment = Some great directory ??????? force create mode = 0660 ??????? force directory mode = 0770 ??????? guest ok = Yes ??????? guest only = Yes ??????? path = /var/www/html/ ??????? read only = No =============