Skip to content

Commit 5214317

Browse files
committed
resolvconf: remember if any subscriber errored
And if they did, re-run on the next go-around even if the internal state did not change. This allows the subscribers to be noisy incase the admin missed the first message.
1 parent 809ed9c commit 5214317

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

resolvconf.in

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ a)
13561356

13571357
if $changedfile; then
13581358
printf "%s\n" "$resolv" >"$KEYDIR/$key" || exit $?
1359-
elif ! $changed; then
1359+
elif ! $changed && [ ! -e "$VARDIR"/error ]; then
13601360
exit 0
13611361
fi
13621362
unset changed changedfile oldmetric newmetric x oldexcl
@@ -1377,7 +1377,7 @@ d)
13771377
"$EXCLUSIVEDIR/"*" $i" || exit $?
13781378
done
13791379

1380-
if ! $changed; then
1380+
if ! $changed && [ ! -e "$VARDIR"/error ]; then
13811381
# Set the return code based on the forced flag
13821382
$force
13831383
exit $?
@@ -1396,7 +1396,9 @@ C)
13961396
echo " " >"$i" || exit $?
13971397
fi
13981398
done
1399-
$changed || exit 0
1399+
if ! $changed && [ ! -e "$VARDIR"/error ]; then
1400+
exit 0
1401+
fi
14001402
unset changed i
14011403
;;
14021404

@@ -1411,7 +1413,9 @@ c)
14111413
rm "$i" || exit $?
14121414
fi
14131415
done
1414-
$changed || exit 0
1416+
if ! $changed && [ ! -e "$VARDIR"/error ]; then
1417+
exit 0
1418+
fi
14151419
unset changed i
14161420
fi
14171421
;;
@@ -1463,4 +1467,9 @@ for script in "$LIBEXECDIR"/*; do
14631467
retval=$(($retval + $?))
14641468
fi
14651469
done
1470+
if [ "$retval" = 0 ]; then
1471+
rm -f "$VARDIR"/error
1472+
else
1473+
echo "$retval" >"$VARDIR"/error
1474+
fi
14661475
exit $retval

0 commit comments

Comments
 (0)