[systemd-devel] [PATCH] preset-transient

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Thu Feb 12 02:46:38 PST 2015


On 11 February 2015 at 20:40, Lennart Poettering <lennart at poettering.net> wrote:
> On Thu, 05.02.15 16:11, Dimitri John Ledkov (dimitri.j.ledkov at intel.com) wrote:
>
>> Some context for this patch.
>>
>> I would like to support a new preset model, which has the following properties:
>>
>>  - distribution shipped defaults are enabled
>>  - and are applied to each boot/upgrade
>>  - without overriding any user configuration
>>
>> In many ways it is very similar to existing functionality but not
>> quite possible to achieve all of the above.
>>
>> Thus, I'm introducing a new optional functionality, new unit
>> configuration directory, and new transient-preset configurations.
>>
>> On each boot, if TransientPreset=yes, presets from
>> /usr/lib/systemd/system-preset-transient/*.preset are applied into
>> configuration path /run/systemd/system-preset-transient/.
>
> Why do we need an option for this? Can't the logic be to do this
> unconditionally if the /run/systemd/system-preset-transient/ dir
> exists and is non-empty?
>

Well /run/systemd/system-preset-transient/ does not exist on boot, but
rather created when transient-presets are applied. I guess, it's a
typo, and you meant /usr/lib/systemd/system-preset-transient dir
exists and is non-empty. That would be good, however, unlike normal
presets it would not give the user option to opt-into/opt-out as
easily. (With normal presets /etc/machine-id is the flag file, which
is accessible to the user to provision/unprovision, together with any
desired overrides in /etc/systemd/system-preset/*.preset).

Would it be good if I change this portion of the patch logic as follows:
* drop all the configure/option flag cruft
* if /usr/lib/systemd/system-preset-transient/ or
/etc/systemd/system-preset-transient exist and are not empty - run
transient presets

The logic to apply system-presets remains the same. If a distro
chooses not to use system-presets, it should either guarantee
pre-generated /etc/machine-id, or ship "disable *" preset policy.

> Configuration options are for user/admins, but I am pretty sure this
> is a distro choice, not something the admin should be able to toggle
> without change the distro.

It is a distro choice to use presets, transient-presets, or both.
However, it seemed to me at the time that it should be offered to the
user to opt-out of distro choice, or opt-in into things not enabled by
distro. Thus I made it very explicit transient-presets config option.
I guess autodetecting them is mode of least surprise.

-- 
Regards,

Dimitri.

Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the systemd-devel mailing list