[systemd-devel] .d directories order

Andrei Borzenkov arvidjaar at gmail.com
Mon Oct 20 19:47:26 PDT 2014


В Mon, 20 Oct 2014 20:48:01 +0200
Lennart Poettering <lennart at poettering.net> пишет:

> 
> Well, as for units the main file should be read first (taking the
> /usr+/etc override logic into account), and only then we should read
> the .d/ drop-ins (individually following the /usr+/etc override
> logic). THis is what we do for unit files too.
> 


Thus should really be documented ... currently it is not clear at all;
it just says

--><--
All files with the suffix <literal>.conf</literal> from
this directory will be parsed after the file itself is parsed
--><--

without mentioning what happens when multiple .d directories exist. When
reading above literally, and trying to infer what happens from paths
order in the same manual, one rather thinks about order

/usr/lib/.../foo.service
/usr/lib/.../foo.service.d
/etc/../foo.service
/etc/.../foo.service.d

I was sure it works this way ...

Also I was rather surprised when reading

--><--
for instanced units this
logic will first look for the instance <literal>.d/</literal>
subdirectory and read its <literal>.conf</literal> files, followed by
the template <literal>.d/</literal> subdirectory and reads its
<literal>.conf</literal> files
--><--

Given that files read later override files read earlier this sounds
like settings in template override settings in instance?!?


More information about the systemd-devel mailing list