[systemd-devel] [PATCH] Add support for transient presets, applied on every boot.

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


On 11 February 2015 at 20:43, Lennart Poettering <lennart at poettering.net> wrote:
> On Thu, 05.02.15 16:11, Dimitri John Ledkov (dimitri.j.ledkov at intel.com) wrote:
>
>>
>> -static int get_config_path(UnitFileScope scope, bool runtime, const char *root_dir, char **ret) {
>> +static int get_config_path(UnitFileScope scope, bool runtime, bool preset, const char *root_dir, char **ret) {
>>          char *p = NULL;
>>          int r;
>>
>> @@ -71,7 +71,10 @@ static int get_config_path(UnitFileScope scope, bool runtime, const char *root_d
>>          case UNIT_FILE_SYSTEM:
>>
>>                  if (runtime)
>> -                        p = path_join(root_dir, "/run/systemd/system", NULL);
>> +                        if (preset)
>> +                                p = path_join(root_dir, "/run/systemd/system-preset-transient", NULL);
>> +                        else
>> +                                p = path_join(root_dir,
>> "/run/systemd/system", NULL);
>
> Hmm, shouldn't we just apply this directly to /run/systemd/system?
> There's no real need to keep this separate?
>
> I mean if the user shall be able to undo changes made by these presets
> with "systemctl --runtime disable" it would be good not to introduce a
> new dir for all of this...

Yes, we can reuse existing dir for this. But was not entirely sure
about that initially when writting this, would simplify a few things
in this patch.

-- 
Regards,

Dimitri.

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


More information about the systemd-devel mailing list