[systemd-devel] Systemd loads units before btrfs subvolumes are mounted

Jóhann B. Guðmundsson johannbg at gmail.com
Wed May 25 15:42:29 UTC 2016


On 05/25/2016 03:22 PM, Lennart Poettering wrote:

> On Wed, 25.05.16 10:05, Jóhann B. Guðmundsson (johannbg at gmail.com) wrote:
>
>> <snip>
>>
>> You will always risk ending up with a race condition if you place your type
>> units outside the official directories.
>>
>> /etc/systemd/system/*  ( Administrators )
>> /run/systemd/system/* ( Temporary )
>> /usr/lib/systemd/system/* ( Vendors )
>>
>> Arguably the support running/loading type unit files outside the above
>> directories should be altogether removed or at least a warning issues since
>> this is bound to create administrative mess ( as was apparent when vendor
>> did something like that with legacy sys v init ).
> I don#t really agree I must say.

It's classic ( sys v ) init brokenness in which vendors placed their 
stuff in opt ( or elsewhere ) which more often than not was a) on 
separated partition b) on separated sub-volume c) on a network drive ( 
nfs and the likes ) then symbolic linked ( through install script ( 
which usually do more harm than good since such scripts assumptions are 
way off with the environment and infrastructure policy's ) to one of the 
classic init.d directories which led to the exactly same racy condition 
( if legacy sysv initscript and or type units depend on something else ) 
and brokenness as he's experiencing here.

What's the use case for placing type unit files outside those 
directories and supporting following symlinks to them?

Why dont you always want to require type unit files to be placed in 
those directories to prevent things like he's experiencing and I 
mentioned above from happening?

JBG


More information about the systemd-devel mailing list