On 23.09.22 16:52, Ronald Wimmer via FreeIPA-users wrote:
On 20.09.22 11:03, Sam Morris via FreeIPA-users wrote:
> On 19/09/2022 13:18, Ronald Wimmer via FreeIPA-users wrote:
>>>> So... we get closer. Ages ago we put the following performance
>>>> tuning options to /etc/fstab:
>>>>
>>>> #Performancetuning for SSSD/IPA
>>>> tmpfs /var/lib/sss/db/ tmpfs size=1024M,mode=0700
>>>>
>>>> It looks like the directory is not created anymore by this entry.
>>>
>>> systemctl status var-lib-sss-db.mount
>>> ● var-lib-sss-db.mount - /var/lib/sss/db
>>> Loaded: loaded (/etc/fstab; enabled-runtime; vendor preset:
>>> disabled)
>>> Active: active (mounted) since Mon 2022-09-19 13:42:02 CEST;
>>> 1min 30s ago
>>> Where: /var/lib/sss/db
>>> What: tmpfs
>>> Docs: man:fstab(5)
>>> man:systemd-fstab-generator(8)
>>> Tasks: 0 (limit: 49753)
>>> Memory: 8.0K
>>> CGroup: /system.slice/var-lib-sss-db.mount
>>>
>>> Sep 19 13:42:02 pipa01.linux.oebb.at systemd[1]:
>>> var-lib-sss-db.mount: Directory /var/lib/sss/db to mount over is not
>>> empty, mounting anyway.
>>> Sep 19 13:42:02 pipa01.linux.oebb.at systemd[1]: Mounting
>>> /var/lib/sss/db...
>>> Sep 19 13:42:02 pipa01.linux.oebb.at systemd[1]: Mounted
>>> /var/lib/sss/db.
>>>
>>> Looks okay but the db directory is NOT present.
>>
>> Adding X-mount.mkdir to the options of the respective fstab line
>> creates the directory. However, I am not aware of a possibility to
>> specify owner/group (sssd) of that particular directory.
>
> Perhaps a tmpfiles.d(5) drop-in with a z-line can be used to restore
> the owner/group/context during boot?
Thanks for the input. I solved it by creating and override
systemctl edit var-lib-sss-db.mount
with this content
[Mount]
Options=uid=sssd,gid=sssd
But I still do not know why systemd ignores both options when reading
/etc/fstab - Sure,
https://www.freedesktop.org/software/systemd/man/systemd.mount.html says
"Note that the options User= and Group= are not useful for mount units.
systemd passes two parameters to mount(8); the values of What= and
Where=. When invoked in this way, mount(8) does not read any options
from /etc/fstab, and must be run as UID 0." But why?