[Pkg-samba-maint] Bug#953530: Bug#953530: samba-common-bin: post-install fails with "lock directory /run/samba does not exist"

Michael Tokarev mjt at tls.msk.ru
Wed Mar 23 19:56:45 GMT 2022


23.03.2022 18:18, L.P.H. van Belle wrot:
> This one is fixed some time ago, so, im wondering why we see it here.
> But this is most probely due the left overs of an older samba version.
> As TP says.. Uses sysvinit.

That's why.

> A quick peek the sources here.
> I do notice d/samba-common.postrm removes it..

it doesn't matter since this is done after removal of the package.

> d/samba-common.postrm:    rm -Rf /run/samba/ /var/cache/samba/ /var/lib/samba
> 
> d/rules:  echo "d /run/samba 0755 root root -" > $(DESTDIR)/usr/lib/tmpfiles.d/samba.conf

this is handled by systemd. Systemd creates this dir once it sees this samba.conf
file (using inotify or with explicit notifier).  But in case of systemd,
no one creates it.

> Maybe we should add also an extra entry in samba-common-bin.dirs
> Since its fails on that package.

No. /run is a tmpfs. The dir will be gone after reboot. This is why it
is done from tmpfiles.d. The very easy fix is to explicitly create the
directory in postinst script before it can be needed. It is as simple
as adding one-line `mkdir -p /run/samba' - maybe before tmpfiles.d
processing (or whatever it is in the #DEBHELPER# placeholder).

/mjt



More information about the Pkg-samba-maint mailing list