Fixes PowerShell daemon service registration

This commit is contained in:
Lord Hepipud 2019-11-03 16:59:45 +01:00
parent f67224114a
commit cfba374227

View file

@ -27,5 +27,11 @@ function Install-IcingaFrameworkService()
throw ([string]::Format('Failed to install Icinga PowerShell Service: {0}{1}', $ServiceCreation.Message, $ServiceCreation.Error)); 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'); return (Set-IcingaAgentServiceUser -User $User -Password $Password -Service 'icingapowershell');
} }