[Samba] Multi instance samba problem after updating from 4.15.5 to 4.17.4

Michael Tokarev mjt at tls.msk.ru
Tue Jan 10 20:07:13 UTC 2023


10.01.2023 22:02, Peter Varkoly via samba wrote:
> Hi,
> 
> I have 3 samba instances running on one server: samba AD file and a printserver instance.
> After updating to 4.17.4 I have the problem, that connecting the one instance with smbclient or from a windows client sometimes the shares of the 
> other instance will be listed.

I tried running several instances like this, - had to fight with multiple issues, and finally
decided to run samba in containers instead.  This is possible to do off the same root filesystem
(by mounting different /etc/samba/, /var/lib/samba/, /var/cache/samba/ and /var/log/samba/ for
each instance). I abused systemd-nspawn for this, but had to fight with it too, as it has quite
some checks in place which prevents it from running a container off system root.

Apparently it should be possible to do it in one system with multiple IP addresses and a lot
of configuration, - it *should* work.  Provided nothing wants to use localhost directly
(like samba-tool or smbpasswd).

> The behavior is such that this behavior remains stable for a while, then changes and the correct shares are delivered again. This is about 1 minunte.
> In the logfiles of the instances it is evident that the instances have read the correct configuration.

This smells like some cache - which is most often in /run/samba/ - is being used by multiple
instances.  Or something else is cross-using stuff.

If it were me, I'd move regular samba dirs - which are the ones I listed above - into
subdirs each for each instance, so there's nothing in there "by default", - any file
appearing directly in any of these dirs indicates a misconfiguration.  Your AD DC config
does not have all the *directory set up, so any misconfig in other instances means that
instance will use files by AD DC instance.

Plus, a less radical, do an lsof for all the processes running and see if there are
some files open which should not be.

Thanks,

/mjt



More information about the samba mailing list