[Samba] sockets in /var/lib

Michael Tokarev mjt at tls.msk.ru
Tue Sep 12 08:49:48 UTC 2023


12.09.2023 11:40, Andrew Bartlett via samba:
> On Tue, 2023-09-12 at 11:07 +0300, Michael Tokarev wrote:
>> Generally, samba does place its files a bit arbitrary and
>> unthinkfully.For example, in debian I have a patch which move socket
>> directory (whichis definitely a runtime thing, with sockets to
>> communicate with runningprocesses) to lock directory instead of
>> having them in /var/lib/samba/ (!!)where they don't fit at all.
> 
> The main reason that at least some of the sockets are under
> /var/lib/samba is that the socket permisisons are long-term state, even
> if the listeners are ephemeral.

Um.

# ll -a /run/samba/msg.sock/
total 0
drwx------ 2 root root 480 Sep 12 11:43 ./
drwxr-xr-x 7 root root 480 Sep 12 02:50 ../
srwxrwxrwx 1 root root   0 Sep 10 12:28 106=
srwxrwxrwx 1 root root   0 Sep 10 12:28 107=
srwxrwxrwx 1 root root   0 Sep 10 12:28 136=
srwxrwxrwx 1 root root   0 Sep 10 12:28 208=
srwxrwxrwx 1 root root   0 Sep 10 12:28 212=
srwxrwxrwx 1 root root   0 Sep 10 12:28 213=
srwxrwxrwx 1 root root   0 Sep 10 13:55 2173=
srwxrwxrwx 1 root root   0 Sep 11 06:14 25036=
srwxrwxrwx 1 root root   0 Sep 11 06:38 25632=
srwxrwxrwx 1 root root   0 Sep 11 06:43 25766=
srwxrwxrwx 1 root root   0 Sep 11 06:43 25771=
srwxrwxrwx 1 root root   0 Sep 11 06:43 25781=
srwxrwxrwx 1 root root   0 Sep 11 06:43 25795=
srwxrwxrwx 1 root root   0 Sep 11 06:43 25799=

These are 100% runtime things and definitely have no long-term
state at all.  Each socket is named after a process pid, and
the sockets are used by smbcontrol to communicate with running
samba processes.

I'm not talking about

srwxrwxrwx 1 root root 0 Sep 10 12:28 /var/lib/samba/winbindd_privileged/pipe=

for example, or ntp socket, or something like that - these, which
are used by other subsystems, are kept at the same location in
debian.

I'm talking about the 100% transient runtime thing.
msg.sock is not a place for private directory in /var/lib/samba.

/mjt



More information about the samba mailing list