[systemd-devel] several Conditions (AND or OR)
Alexey Shabalin
a.shabalin at gmail.com
Tue Feb 8 02:47:00 PST 2011
On Tue, Feb 8, 2011 at 12:21 PM, Lennart Poettering wrote:
> On Mon, 07.02.11 14:24, Alexey Shabalin wrote:
>> How chenge (Condition1 || Condition2) to (Condition1 && Condition2)
> I'd very much prefer not having to extend the condition language to more
> than what it currently covers. So, before we think about this more, I'd
> like to hear a very good use case for this. Your example doesn't really
> convince me, and I'd suggest a different fix (see above) instead.
Ok. Let's look at fedora-storage-init.service and
ExecStart=/lib/systemd/fedora-storage-init from initscripts in Fedora,
for example.
We see in fedora-storage-init
if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \
[ -x /sbin/multipath ]; then
modprobe dm-multipath > /dev/null 2>&1
/sbin/multipath -v 0
if [ -x /sbin/kpartx ]; then
/sbin/dmsetup ls --target multipath --exec
"/sbin/kpartx -a -p p" >/dev/null
fi
fi
it would be easier to see it as
[Unit]
ConditionKernelCommandLine=!nompath
ConditionPathExists=/etc/multipath.conf
ConditionPathExists=/sbin/multipath
ConditionPathExists=/sbin/kpartx
[Service]
ExecStartPre=modprobe dm-multipath
ExecStart=/sbin/multipath -v 0
ExecStart=/sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a
-p p" >/dev/null
but it will not work :(
--
Alexey Shabalin
More information about the systemd-devel
mailing list