On 07/12/2013 03:40 PM, Kay Sievers wrote:
> On Fri, Jul 12, 2013 at 3:31 PM, Lennart Poettering
> <lenn...@poettering.net> wrote:
> 
>>>>   ConditionFileContains=/sys/module/sn/parameters/enabled:1
> 
>> 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...

We can workaround this one way or another - be it shell script,
udev rule or, in some cases, generator. Patch that started this
discussion is yet another option.

I have looked into /etc/init.d on my Debian system and found
following examples of 'grepping' files used to decide if given
service should be started or not:

 - kernel option specified - /proc/cmdline
 - filesystem available - /proc/filesystems
 - file contains non commented out lines - /etc/exports
 - cpu features available - /proc/cpuinfo
 - software raid (md) status - /proc/mdstat
 - ...

Every such case could be handled by generic "built-in grep"
instead of dozen of flags like ConditionCPUFeature=,
ConditionMDStatus=, ...

Having said that I fully understand that the line has to be
drawn somewhere.


[1] Such condition should probably support globs so we would
    end up with something like ConditionFileContentsGlob=

> Just a note:
> The above example should be triggered by a udev rule anyway.

Agreed.

Thanks
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to