From cfba374227fb6ac48c3603d82dd2aac12ee87d91 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 3 Nov 2019 16:59:45 +0100 Subject: [PATCH] Fixes PowerShell daemon service registration --- lib/core/framework/Install-IcingaFrameworkService.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/framework/Install-IcingaFrameworkService.psm1 b/lib/core/framework/Install-IcingaFrameworkService.psm1 index ebf4db2..7fecc27 100644 --- a/lib/core/framework/Install-IcingaFrameworkService.psm1 +++ b/lib/core/framework/Install-IcingaFrameworkService.psm1 @@ -27,5 +27,11 @@ function Install-IcingaFrameworkService() throw ([string]::Format('Failed to install Icinga PowerShell Service: {0}{1}', $ServiceCreation.Message, $ServiceCreation.Error)); } + # This is just a hotfix to ensure we setup the service properly before assigning it to + # a proper user, like 'NT Authority\NetworkService'. For some reason the NetworkService + # will not start without this workaround. + # Todo: Figure out the reason and fix it properly + Set-IcingaAgentServiceUser -User 'LocalSystem' -Service 'icingapowershell' | Out-Null; + return (Set-IcingaAgentServiceUser -User $User -Password $Password -Service 'icingapowershell'); }