Hi,

in ocf:heartbeat:exportfs (as found in SLES11 SP1) there is a problem with 
"grep -zqs":
The "-z" is expected to fix the problem where exportfs splits a lenghty name 
into two lines. Unfortunately exportfs does not output any binary zeros that 
"grep -z" is looking for. Thus effectively "-z" makes grep succeed when it 
shouldn't.

Source:
exportfs_monitor ()
{
        # "grep -z" matches across newlines, which is necessary as
        # exportfs output wraps lines for long export directory names
        exportfs | grep -zqs 
"${OCF_RESKEY_directory}[[:space:]]*${OCF_RESKEY_clientspec}"
[...]

Example (test):
# exportfs | grep -z h06
/home/windl/src/scripts/OCF/twuc/.git/objects/39
                h02
/home/windl/src/scripts/OCF/twuc/.git/objects/39
                h06
/mnt            h02
/mnt            h06
# exportfs | grep h06
                h06
/mnt            h06

So you see "grep -z" does produce false results. Probably never tested...
BTW: Shouldn't the match be "anchored"? ^$directory ... $host\$

Regards,
Ulrich


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to