On Wed, 10 Jan 2024 16:13:54 +0300
Michael Tokarev via samba <samba at lists.samba.org> wrote:
> Hi.
>
> Today we had a prob on one of our servers. Dunno if this is something
> new or has been there for long. The prob is that system logs has been
> filled with the same error message from samba (more than 25Gig of
> them):
>
> Jan 10 16:05:03 host smbd[2828042]: [2024/01/10 16:05:03.982719, 0,
> pid=2828042]
> ../../source3/passdb/pdb_smbpasswd.c:333(startsmbfilepwent) Jan 10
> 16:05:03 host smbd[2828042]: startsmbfilepwent_internal: failed to
> set 0600 permissions on password file /etc/samba/smbpasswd. Error was
> Read-only file system Jan 10 16:05:03 host smbd[2828042]: .Unable
> to open passdb database.
>
> (this is logged more than 100 times per second).
>
> This file (/etc/samba/smbpasswd) has always been there (more than 10
> years), it contains a few static entries. It has always been mode
> 0600. And it is quite usual for our configs to have root filesystem
> read-only. So I don't really know when popped up just today.
>
> Samba version is 4.17, but the same code exists in 4.19 too.
>
> What's the deal, why samba tries to chmod this file at open, _ever_?
> This should not be done..
>
> Unfortunately, this incident demonstrated that the legacy logging
> system is incapable, - in order to stop the filesystem from filling
> up like this, I removed the old syslog daemon entirely, leaving only
> systemd journal files - this one keeps the logs under control.
>
> Thanks,
>
> /mjt
>
I have no idea why it should just start appearing in your logs now, as
far as I am aware, that piece of code hasn't changed in years, but if
you are saying that the systemd journal doesn't log that message, then,
in my opinion, the systemd journal is faulty, what else isn't it
logging ?
Your problem is that you have your configs on a read-only filesystem,
this is your choice, so you have to put up with the fall out.
Rowland