Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/100-General/10-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Bugfixes

* [#683](https://github.com/Icinga/icinga-powershell-framework/pull/683) Fixes JEA installer to exclude domain from user name length check, which can easily exceed the Windows 20 digits username limit
* [#685](https://github.com/Icinga/icinga-powershell-framework/pull/685) Fixes an issue while trying to stop the JEA process in certain cases, which results in an error during installation but has no other effect on the environment
* [#686](https://github.com/Icinga/icinga-powershell-framework/pull/686) Fixes certutil error handling and message output in case the icingaforwindows.pfx could not be created

### Enhancements
Expand Down
4 changes: 4 additions & 0 deletions lib/core/jea/Get-IcingaJEAServicePid.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ function Get-IcingaJEAServicePid()
$JeaPid = $JeaPid.Replace("`r`n", '').Replace("`n", '').Replace(' ', '');
}

if ([string]::IsNullOrEmpty($JeaPid) -Or $JeaPid -eq '0' -Or $JeaPid -eq 0) {
return $null;
}

return $JeaPid;
}
2 changes: 1 addition & 1 deletion lib/core/windows/Restart-IcingaWindowsService.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Restart-IcingaWindowsService()
Stop-IcingaService -Service 'icingapowershell';

if ((Test-IcingaJEAServiceRunning -JeaPid $JeaPid)) {
Stop-Process -Id $JeaPid -Force;
Stop-IcingaJEAProcess -JeaPid $JeaPid;
}

Restart-IcingaService -Service 'icingapowershell';
Expand Down
33 changes: 33 additions & 0 deletions lib/core/windows/Stop-IcingaJEAProcess.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function Stop-IcingaJEAProcess()
{
param (
[string]$JeaPid = $null
);

if ([string]::IsNullOrEmpty($JeaPid)) {
[string]$JeaPid = Get-IcingaJEAServicePid;
}

if ([string]::IsNullOrEmpty($JeaPid)) {
return;
}

if ($JeaPid -eq '0' -Or $JeaPid -eq 0) {
return;
}

$JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue;
if ($null -eq $JeaPowerShellProcess) {
return;
}

if ($JeaPowerShellProcess.ProcessName -ne 'wsmprovhost') {
return;
}

try {
Stop-Process -Id $JeaPid -Force -ErrorAction Stop;
} catch {
Write-IcingaConsoleError 'Unable to stop the JEA process "wsmprovhost" caused by the following error: "{0}".' -Objects $_.Exception.Message;
}
}