BBlack has submitted this change and it was merged.

Change subject: puppet-run: pre-check agent lock before apt
......................................................................


puppet-run: pre-check agent lock before apt

Change-Id: I10696dd23c39ef3ab38c4d69182d33cabb02d5b6
---
M modules/base/files/puppet/puppet-run
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/modules/base/files/puppet/puppet-run 
b/modules/base/files/puppet/puppet-run
index 4549f2d..451fbe5 100644
--- a/modules/base/files/puppet/puppet-run
+++ b/modules/base/files/puppet/puppet-run
@@ -13,6 +13,14 @@
 touch /var/log/puppet.log
 chmod 600 /var/log/puppet.log
 
+# Check this before apt-get update, so that our update doesn't screw up
+# package installs in a running (manual and/or initial install) puppet run
+PUPPETLOCK=`puppet agent --configprint agent_catalog_run_lockfile`
+if [ -n "$PUPPETLOCK" -a -e "$PUPPETLOCK" ]; then
+    echo Skipping this run, puppet agent already running at pid `cat 
$PUPPETLOCK` >>/var/log/puppet.log
+    exit 0
+fi
+
 timeout $KILL_TIMEOUT 300 apt-get update -qq >> /var/log/puppet.log 2>&1
 
 timeout $KILL_TIMEOUT 1800 puppet agent \

-- 
To view, visit https://gerrit.wikimedia.org/r/196162
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I10696dd23c39ef3ab38c4d69182d33cabb02d5b6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to