BBlack has submitted this change and it was merged.
Change subject: Kill info-level spam on authdns-update w/ gdnsd 2.x
......................................................................
Kill info-level spam on authdns-update w/ gdnsd 2.x
Change-Id: Icf60d31b494c734d75c956860e99e13edb6b5945
---
M modules/authdns/files/authdns-local-update
1 file changed, 18 insertions(+), 8 deletions(-)
Approvals:
BBlack: Verified; Looks good to me, approved
diff --git a/modules/authdns/files/authdns-local-update
b/modules/authdns/files/authdns-local-update
index d1355b5..4a2ec8e 100644
--- a/modules/authdns/files/authdns-local-update
+++ b/modules/authdns/files/authdns-local-update
@@ -20,6 +20,10 @@
die "this script needs root"
fi
+# 1.x and 2.x have differences
+GDNSD_V2=1
+(gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || GDNSD_V2=0
+
# setup locking; only one copy of this may be running at the same time
LOCKFILE=/var/lock/authdns-local-update
LOCKFD=9
@@ -94,11 +98,20 @@
exit 0
fi
-if ! gdnsd checkconf 2>/dev/null; then
- if [ -f /etc/gdnsd/config~ ]; then
- mv /etc/gdnsd/config~ /etc/gdnsd/config
+if [ $GDNSD_V2 -eq 1 ]; then
+ if ! gdnsd checkconf >/dev/null; then
+ if [ -f /etc/gdnsd/config~ ]; then
+ mv /etc/gdnsd/config~ /etc/gdnsd/config
+ fi
+ die "gdnsd checkconf failed, aborting"
fi
- die "gdnsd checkconf failed, aborting"
+else
+ if ! gdnsd checkconf 2>/dev/null; then
+ if [ -f /etc/gdnsd/config~ ]; then
+ mv /etc/gdnsd/config~ /etc/gdnsd/config
+ fi
+ die "gdnsd checkconf failed, aborting"
+ fi
fi
### reload
@@ -110,10 +123,7 @@
else
rm -f /etc/gdnsd/config~
echo "Reloading zones"
- # 1.x and 2.x have different commands to reload zones
- v2=1
- (gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || v2=0
- if [ $v2 -eq 1 ]; then
+ if [ $GDNSD_V2 -eq 1 ]; then
gdnsd reload-zones
else
gdnsd reload
--
To view, visit https://gerrit.wikimedia.org/r/168964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf60d31b494c734d75c956860e99e13edb6b5945
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits