From 1eeeb330d350a4fb2f848f08121e6a4fde66a576 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 26 Feb 2018 11:15:21 +0800 Subject: [PATCH 1/3] (PE-23563) Stop MCO prior to initiating MSI install Previously it was possible to get into a strange race condition where the MSI was able to propertly stop the MCollective service prior to upgrade. This commit attempts to stop the mco service prior to the MSI being invoked, giving the service more time to stop correctly. --- templates/install_puppet.bat.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/install_puppet.bat.erb b/templates/install_puppet.bat.erb index a2dfabc35..f75ba88d8 100644 --- a/templates/install_puppet.bat.erb +++ b/templates/install_puppet.bat.erb @@ -39,6 +39,8 @@ REM sets its startup type, which prevents installs from proceeding. REM This may fail on agents without pxp-agent, but since this is not REM run interactively and the next command sets ERRORLEVEL, it's OK. net stop pxp-agent +REM Same for the Marionette Collective Service +net stop mcollective <% if @msi_move_locked_files %> REM Move puppetres.dll to avoid file locks and service restarts (MODULES-4207) From faaaf225779f24abb24ced077762365288f2a8ad Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 26 Feb 2018 11:17:43 +0800 Subject: [PATCH 2/3] (PE-23563) Stop Puppet prior to MSI install Previously it was possible to get into a strange race condition where the MSI was able to propertly stop the Puppet Agent service prior to upgrade. This commit attempts to stop the puppet service prior to the MSI being invoked, giving the service more time to stop correctly. --- templates/install_puppet.bat.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/install_puppet.bat.erb b/templates/install_puppet.bat.erb index f75ba88d8..9db8105c5 100644 --- a/templates/install_puppet.bat.erb +++ b/templates/install_puppet.bat.erb @@ -39,8 +39,9 @@ REM sets its startup type, which prevents installs from proceeding. REM This may fail on agents without pxp-agent, but since this is not REM run interactively and the next command sets ERRORLEVEL, it's OK. net stop pxp-agent -REM Same for the Marionette Collective Service +REM Same for the Marionette Collective Service and Puppet Agent service net stop mcollective +net stop puppet <% if @msi_move_locked_files %> REM Move puppetres.dll to avoid file locks and service restarts (MODULES-4207) From 661f590685d355517d8608c981726c9a2bb70688 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 26 Feb 2018 11:19:21 +0800 Subject: [PATCH 3/3] (maint) Dump token privileges for current user Previously it was difficult to debug failed upgrades as it was not possible to know what rights the installation user had at install time. This commit logs the current user's rights prior to the upgrade. --- templates/install_puppet.bat.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/install_puppet.bat.erb b/templates/install_puppet.bat.erb index 9db8105c5..f043a7879 100644 --- a/templates/install_puppet.bat.erb +++ b/templates/install_puppet.bat.erb @@ -43,6 +43,9 @@ REM Same for the Marionette Collective Service and Puppet Agent service net stop mcollective net stop puppet +REM Log the current user token privileges for debugging +whoami /all + <% if @msi_move_locked_files %> REM Move puppetres.dll to avoid file locks and service restarts (MODULES-4207)