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

2013-07-13 Thread Karol Lewandowski
On Fri, Jul 12, 2013 at 09:19:58PM +0200, Lennart Poettering wrote: On Fri, 12.07.13 20:42, Karol Lewandowski (k.lewando...@samsung.com) wrote: ... - software raid (md) status - /proc/mdstat Not sure what this is really doing... /etc/init.d/hdparm seems to be bailing out if md-raid is not

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

2013-07-12 Thread Łukasz Stelmach
It was 2013-07-12 pią 04:48, when Kyungmin Park wrote: On Fri, Jul 12, 2013 at 7:43 AM, Lennart Poettering lenn...@poettering.net wrote: On Thu, 11.07.13 13:37, Dave Reisner (d...@falconindy.com) wrote: +p = strchr(path, ':'); This is going to fail for a file:value pair such as

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

2013-07-12 Thread Łukasz Stelmach
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

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

2013-07-12 Thread Lennart Poettering
On Fri, 12.07.13 11:48, Kyungmin Park (kmp...@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 ];

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

2013-07-12 Thread Lennart Poettering
On Fri, 12.07.13 10:16, Łukasz Stelmach (l.stelm...@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.

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

2013-07-12 Thread Kay Sievers
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,

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

2013-07-12 Thread Karol Lewandowski
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

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

2013-07-12 Thread Lennart Poettering
On Fri, 12.07.13 20:42, Karol Lewandowski (k.lewando...@samsung.com) 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

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

2013-07-11 Thread Karol Lewandowski
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

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

2013-07-11 Thread Dave Reisner
On Thu, Jul 11, 2013 at 07:18:35PM +0200, 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

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

2013-07-11 Thread Lennart Poettering
On Thu, 11.07.13 19:18, Karol Lewandowski (k.lewando...@samsung.com) 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 Hmm, I don't

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

2013-07-11 Thread Lennart Poettering
On Thu, 11.07.13 13:37, Dave Reisner (d...@falconindy.com) wrote: +p = strchr(path, ':'); This is going to fail for a file:value pair such as /foo:/bar/baz:value. You could use strrchr(), but then you have to be concerned about matching values with a colon. This might become a

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

2013-07-11 Thread Kyungmin Park
On Fri, Jul 12, 2013 at 7:43 AM, Lennart Poettering lenn...@poettering.net wrote: On Thu, 11.07.13 13:37, Dave Reisner (d...@falconindy.com) wrote: +p = strchr(path, ':'); This is going to fail for a file:value pair such as /foo:/bar/baz:value. You could use strrchr(), but then you