On Thu, Apr 12, 2012 at 03:20:08PM +0200, Ulrich Windl wrote:
> 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\$


https://github.com/ClusterLabs/resource-agents/commit/5b0bf96e77ed3c4e179c8b4c6a5ffd4709f8fdae

There also was a medium length discussion on the mailing list on that.


-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to