On 07/20/2018 11:41 AM, Andreas Henriksson wrote:
> On Fri, Jul 20, 2018 at 10:51:14AM +0700, Arnaud Rebillout wrote:
> [...]
>> Just my two cents: I find this behavior a bit fragile. It means that an
>> application can't reliably use /tmp during boot time.
>>
>> How do we know which application needs to create a temporary file when
>> they're started? This is internal to the implementation, we can't really
>> make any assumption on that. To be on the safe-side, then we should
>> ensure that every service runs after tmpfiles cleaned up /tmp.
>>
>> How many services do that at the moment? Let me have a look on my machine:
>>
>> $ grep -rn 'After=systemd-tmpfiles' /lib/systemd/
>> /lib/systemd/system/rpcbind.service:4:After=systemd-tmpfiles-setup.service
>>
>> Only one on my machine, that's not much. It makes me wonder how many
>> services out there, like console-setup, use /tmp at boot time, without
>> knowing that there's a risk that systemd-tmpfiles break them.
> You are over generalizing since you forgot to account for this
> particular line/setting:
> https://sources.debian.org/src/console-setup/1.184/debian/console-setup-linux.console-setup.service/#L3

Thanks for the clarification.

So I can now see that `systemd-tmpfiles-setup.service` sets
`Before=sysinit.target`.

And from systemd.service (5), service files have a default dependency
`After=sysinit.target`. That's what keeps them safe, and why the world
keeps turning :)

Hence only services that need to set `DefaultDependencies=no` need to be
careful about tmpfiles (and probably other things then).

Thanks again,

  Arnaud

_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to