diff options
author | Martin Schwenke <martin@meltin.net> | 2011-04-13 12:37:42 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-11 15:01:39 +1000 |
commit | 19713362006c21b719dd8dc01120f3141ad9b578 (patch) | |
tree | 894aaaf0d06626e4228ed8d75cf1154ad174464c | |
parent | f9e58b502fe84b2a7d0f08c19f2df265089766ba (diff) | |
download | samba-19713362006c21b719dd8dc01120f3141ad9b578.tar.gz samba-19713362006c21b719dd8dc01120f3141ad9b578.tar.xz samba-19713362006c21b719dd8dc01120f3141ad9b578.zip |
Eventscripts: fix regression in 60.nfs export checking.
Commit 35a60a63a9b5c7d98dde514ae552239506b691c9 introduced a
regression, reported by "Jonathan Buzzard" <J.Buzzard@dundee.ac.uk>,
as follows:
Basically the use of sed in the following code snippet does not work
for long exports where exportfs wraps the host or network onto the
next line.
exportfs | grep -v '^#' | grep '^/' |
sed -e 's/[[:space:]]*[^[:space:]]*$//' |
ctdb_check_directories
The result is that the you get lots of blank lines being sent to
ctdb_check_directories which causes the host to be marked as
unhealthy and then thrashing sets in of the managed IP's making the
whole cluster unusable.
This tightens up the sed expression so that it is less likely to
produce a spurious empty line. It also removes an unnecessary "grep -v".
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit bd39b91ad12fd05271a7fced0e6f9d8c4eba92e6)
-rwxr-xr-x | ctdb/config/events.d/60.nfs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index e77804836b..23f447f901 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -61,9 +61,9 @@ case "$1" in monitor) # and that its directories are available [ "$CTDB_NFS_SKIP_SHARE_CHECK" = "yes" ] || { - exportfs | grep -v '^#' | grep '^/' | - sed -e 's/[[:space:]]\+[^[:space:]]*$//' | - ctdb_check_directories + exportfs -v | grep '^/' | + sed -r -e 's@[[:space:]]+[^[:space:]()]+\([^[:space:]()]+\)$@@' | + ctdb_check_directories } || exit $? update_tickles 2049 |