From b8fcaa129b7d56292ad293f96b9d514ca47329f3 Mon Sep 17 00:00:00 2001 From: khandelwalbrijesh Date: Fri, 14 Jun 2019 16:51:46 +0530 Subject: [PATCH 1/2] KillService ps file removed --- .../src/InstallAndRunService.bat | 2 +- .../NodeAgentService/src/KillService.ps1 | 16 ---------------- .../NodeAgentService/src/NodeAgentService.csproj | 9 +++------ 3 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 src/PatchOrchestrationApplication/NodeAgentService/src/KillService.ps1 diff --git a/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat b/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat index fc90dc4..61d801c 100644 --- a/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat +++ b/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat @@ -52,7 +52,7 @@ REM icacls %workingDir% /grant "Network Service":(OI)(CI)F /T REM Stop the service and uninstall the current version sc stop %serviceName% -powershell -File "KillService.ps1" +taskkill /IM "NodeAgentNTService.exe" /F sc delete %serviceName% REM Cleanup the %workingDir% for all predecided folders. diff --git a/src/PatchOrchestrationApplication/NodeAgentService/src/KillService.ps1 b/src/PatchOrchestrationApplication/NodeAgentService/src/KillService.ps1 deleted file mode 100644 index c53829b..0000000 --- a/src/PatchOrchestrationApplication/NodeAgentService/src/KillService.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -try { - $id = Get-WmiObject -Class Win32_Service -Filter "Name LIKE 'POSNodeSvc'" | Select-Object -ExpandProperty ProcessId - if($id -ne $null) - { - $process = Get-Process -Id $id - if($process.Id -ne $null) - { - taskkill /F /PID $process.Id - } - } -} -catch { - # do nothing. -} - - diff --git a/src/PatchOrchestrationApplication/NodeAgentService/src/NodeAgentService.csproj b/src/PatchOrchestrationApplication/NodeAgentService/src/NodeAgentService.csproj index 5030908..b8d5eb6 100644 --- a/src/PatchOrchestrationApplication/NodeAgentService/src/NodeAgentService.csproj +++ b/src/PatchOrchestrationApplication/NodeAgentService/src/NodeAgentService.csproj @@ -13,9 +13,9 @@ True - - - + + + @@ -46,9 +46,6 @@ PreserveNewest - - PreserveNewest - From 614b7f1af3da275dcf8bfb9ccaa0597a1df66519 Mon Sep 17 00:00:00 2001 From: khandelwalbrijesh Date: Fri, 14 Jun 2019 18:57:53 +0530 Subject: [PATCH 2/2] Added comment in setup script --- .../NodeAgentService/src/InstallAndRunService.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat b/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat index 61d801c..8fefbfe 100644 --- a/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat +++ b/src/PatchOrchestrationApplication/NodeAgentService/src/InstallAndRunService.bat @@ -52,6 +52,8 @@ REM icacls %workingDir% /grant "Network Service":(OI)(CI)F /T REM Stop the service and uninstall the current version sc stop %serviceName% + +REM POSNodeSvc stucks sometimes while stopping. This will unblock that. taskkill /IM "NodeAgentNTService.exe" /F sc delete %serviceName%