<refsect2>
<title>getreclock</title>
<para>
- Show the name of the recovery lock file, if any.
+ Show details of the recovery lock, if any.
</para>
<para>
Example output:
</para>
<screen>
- Reclock file:/clusterfs/.ctdb/recovery.lock
+ /clusterfs/.ctdb/recovery.lock
</screen>
</refsect2>
echo
echo "Check that recovery lock is actually enabled..."
-t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
-if [ "$t" != "No reclock file used." ] ; then
+orig_reclock=$(echo "$out" | sort -u)
+if [ "$orig_reclock" != "" ] ; then
echo "OK: Recovery lock is set"
else
echo "OOPS: Recovery lock is unset. Skipping remainder of test"
fi
echo
-orig_reclock=$(sed -n -e '1s@^Reclock file:@@p' <<<"$out")
-echo "Remember original recovery lock file: \"${orig_reclock}\""
+echo "Original recovery lock file: \"${orig_reclock}\""
echo
echo "Unset and test the recovery lock on all nodes..."
wait_until_recovered
try_command_on_node -v -q all $CTDB getreclock
t=$(sort -u <<<"$out")
-if [ "$t" = "No reclock file used." ] ; then
+if [ "$t" = "" ] ; then
echo "GOOD: Recovery lock unset on all nodes"
else
echo "BAD: Recovery lock not unset on all nodes"
try_command_on_node -pq all $CTDB setreclock "$alt"
wait_until_recovered
try_command_on_node -v -q all $CTDB getreclock
-t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
+t=$(echo "$out" | sort -u)
if [ "$t" = "$alt" ] ; then
echo "GOOD: Recovery lock set on all nodes"
else
wait_until_recovered
try_command_on_node -v all rm -vf "$alt"
try_command_on_node -v -q all $CTDB getreclock
-t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
+t=$(echo "$out" | sort -u)
if [ "$t" = "$orig_reclock" ] ; then
echo "GOOD: Recovery lock restored on all nodes"
else
DEBUG(DEBUG_ERR, ("Unable to get reclock file from node %u\n", options.pnn));
return ret;
} else {
- if (options.machinereadable){
- if (reclock != NULL) {
- printm("%s", reclock);
- }
- } else {
- if (reclock == NULL) {
- printf("No reclock file used.\n");
- } else {
- printf("Reclock file:%s\n", reclock);
- }
+ if (reclock != NULL) {
+ printf("%s\n", reclock);
}
}
return 0;