mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixes JEA service errors not resetting themself
This commit is contained in:
parent
694c31c7fc
commit
051ac452b3
2 changed files with 11 additions and 1 deletions
|
|
@ -36,6 +36,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#451](https://github.com/Icinga/icinga-powershell-framework/pull/451) Fixes PowerShell being unable to enter JEA context if only the Framework is installed and removes the `|` from plugin output, in case a JEA error is thrown that check commands are not present
|
||||
* [#452](https://github.com/Icinga/icinga-powershell-framework/pull/452) Fixes unhandled `true` output on the console while running the installer
|
||||
* [#454](https://github.com/Icinga/icinga-powershell-framework/pull/454) Fixes JEA catalog compiler and background daemon execution in JEA context
|
||||
* [#456](https://github.com/Icinga/icinga-powershell-framework/pull/456) Fixes JEA service error count not resetting itself after a certain amount of time without errors
|
||||
|
||||
### Enhancements
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ function Start-IcingaForWindowsDaemon()
|
|||
|
||||
if ($RunAsService) {
|
||||
[int]$JeaRestartCounter = 1;
|
||||
$FailureTime = $null;
|
||||
while ($TRUE) {
|
||||
if ([string]::IsNullOrEmpty($JeaProfile) -eq $FALSE) {
|
||||
if ([string]::IsNullOrEmpty($JeaPid)) {
|
||||
|
|
@ -86,14 +87,22 @@ function Start-IcingaForWindowsDaemon()
|
|||
}
|
||||
|
||||
Write-IcingaFileSecure -File $JeaPidFile -Value '';
|
||||
$FailureTime = [DateTime]::Now;
|
||||
Write-IcingaEventMessage -EventId 1505 -Namespace Framework -Objects ([string]::Format('{0}/5', $JeaRestartCounter));
|
||||
Start-IcingaForWindowsDaemon -RunAsService:$RunAsService -JEAContext:$JEAContext -JEARestart;
|
||||
|
||||
if (([DateTime]::Now - $FailureTime).TotalSeconds -lt 180) {
|
||||
$JeaRestartCounter += 1;
|
||||
} else {
|
||||
$JeaRestartCounter = 1;
|
||||
}
|
||||
|
||||
$JeaPid = '';
|
||||
}
|
||||
|
||||
Start-Sleep -Seconds 5;
|
||||
$JeaAliveCounter += 1;
|
||||
|
||||
continue;
|
||||
}
|
||||
Start-Sleep -Seconds 100;
|
||||
|
|
|
|||
Loading…
Reference in a new issue