[systemd-devel] several Conditions (AND or OR)

Gustavo Sverzut Barbieri barbieri at profusion.mobi
Mon Feb 7 12:29:15 PST 2011


On Mon, Feb 7, 2011 at 9:24 AM, Alexey Shabalin <a.shabalin at gmail.com> wrote:
> Hello!
> I need define several conditions in [Unit].
> ConditionPathExists=/sbin/startevms
> ConditionKernelCommandLine=!noevms
> Service must run only if both conditions is true.
> Now service run if at least one condition is true.
> How chenge (Condition1 || Condition2)  to (Condition1 && Condition2)

I'd say that for these corner-cases we could simply have a Condition
that runs a binary and checks for return 0/1, it could be a shell
script or C binary that does the check. I fear if we solve it with own
syntax would make it too complex for something that is barely used...
but anyway it could be:

Condition=(PathExists=/sbin/startevms and KernelCommandLine=!noevms)
or (SomethingElse...)


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbieri at gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202


More information about the systemd-devel mailing list