[systemd-devel] [RFC PATCH] condition: add ConditionFileContains=

Kyungmin Park kmpark at infradead.org
Fri Jul 12 07:00:20 PDT 2013


On Fri, Jul 12, 2013 at 10:29 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 12.07.13 11:48, Kyungmin Park (kmpark at infradead.org) wrote:
>
>> It's another question.
>> the main goal of this patch is that supports conditional execution
>> If some services are executed with given condition, it should check
>> some conditions and execute different flow.
>> if [ condition is 1 ]; then
>>     launch A service
>> else if [ condition is 2 ]; then
>>     launch B service
>> else
>>     launch C service
>>
>> current systemd scheme we have to prepare three service file. so can
>> we make it only one service with some unit extension? IOW multipul
>> unit support?
>>
>> [Unit]
>> ...
>> ConditionBlahBlah=1
>>
>> [Unit]
>> ...
>> ConditionBlahBlah=2
>>
>> [Unit]
>> ...
>> ConditionBlahBlah=!1 && !2 or empty line
>
> Unit files are not supposed to be a Turing complete programming
> language, and conditions are suggested only as simple checks for
> optimizing start-up of some services. Their configuration files are
> independent of each other so that we can load/unload them separately.
>
Okay, I knew it's not systemd goal. I just asked does it have plan for
these requirements.
we will create different service files for each purpose.

Thank you,
Kyungmin Park


More information about the systemd-devel mailing list