[systemd-devel] systemd-tmpfiles service related queries
Mantas Mikulėnas
grawity at gmail.com
Mon Oct 2 12:21:43 UTC 2023
On Mon, Oct 2, 2023 at 2:36 PM Pintu Agarwal <pintu.ping at gmail.com> wrote:
> Hi All,
>
> I have a doubt related to systemd-tmpfiles-setup.service.
> This service is mentioned to be started after local-fs.target.
> {{{
> After=local-fs.target systemd-sysusers.service
> Before=sysinit.target shutdown.target
> }}}
> In this case this service takes only ~125ms.
> systemd-tmpfiles-setup.service (123ms)
>
> But in our case (QC chipset, arm64, qual-core), we wanted to move this
> service to start before local-fs.target, so we can push some of our
> services upward.
> {{{
> After=systemd-sysusers.service systemd-journald.service
> Before=local-fs.target sysinit.target shutdown.target
> }}}
> In this case it is taking more than ~1s but it helps to reduce the
> timing of other services.
> systemd-tmpfiles-setup.service (1.177s)
>
> So, I wanted to know two things:
> 1) What is the dependency if starting this service after local-fs target
> only ?
> 2) Is it fine to move this service to start before local-fs.target ?
> What could be the consequences and effect and how to verify it ?
>
The consequences are that if you configure tmpfiles to create something in
a separate mounted filesystem, without this dependency (ordering) it may
accidentally create files in the "lower" mountpoints before the filesystem
is mounted...
The alternative to using local-fs.target is to go through all of your
tmpfiles.d configurations and add specific After=foo.mount or
RequiresMountsFor=/foo/bar ordering – for each filesystem that the
configuration expects to be available – into your tmpfiles service.
--
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20231002/1c2da886/attachment.htm>
More information about the systemd-devel
mailing list