[systemd-devel] [RFC PATCH] condition: add ConditionFileContains=
lennart at poettering.net
Fri Jul 12 06:31:19 PDT 2013
On Fri, 12.07.13 10:16, Łukasz Stelmach (l.stelmach at samsung.com) wrote:
> It was <2013-07-11 czw 19:18>, when Karol Lewandowski wrote:
> > Add ability to test if given file contains specified value.
> > File and expected value are given as one argument separated
> > by colon (":"), i.e.
> > ConditionFileContains=/sys/module/sn/parameters/enabled:1
> > ---
> > As above example suggests we use it to conditionally
> > start service based on kernel module parameter value.
> > This can be (ab)used for other/regular files too.
> > RFC
> I am confused a bit. Although I can see (hardly though) the point but
> I am not sure, yet another condition in unit files is required. IMHO
> systemd can check if files required by a service exist (and some other
> tests which more or less cover test(1) functions) and not lauch the
> service if they does not but, it is up to the service to check the
> files' contents. No matter if it is a single character or a 24Mpix jpeg
> Technically, except for the notes already given by others, the patch
> does not look bad.
To make this clear: I am not keen on adding this. I can see the
usefulness, and the thing is still simple enough so that it would be OK
to add this, but if you guys don't actually need that I'd prefer to keep
our codebase smaller...
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel