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
|
* [#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
|
* [#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
|
* [#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
|
### Enhancements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ function Start-IcingaForWindowsDaemon()
|
||||||
|
|
||||||
if ($RunAsService) {
|
if ($RunAsService) {
|
||||||
[int]$JeaRestartCounter = 1;
|
[int]$JeaRestartCounter = 1;
|
||||||
|
$FailureTime = $null;
|
||||||
while ($TRUE) {
|
while ($TRUE) {
|
||||||
if ([string]::IsNullOrEmpty($JeaProfile) -eq $FALSE) {
|
if ([string]::IsNullOrEmpty($JeaProfile) -eq $FALSE) {
|
||||||
if ([string]::IsNullOrEmpty($JeaPid)) {
|
if ([string]::IsNullOrEmpty($JeaPid)) {
|
||||||
|
|
@ -86,14 +87,22 @@ function Start-IcingaForWindowsDaemon()
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-IcingaFileSecure -File $JeaPidFile -Value '';
|
Write-IcingaFileSecure -File $JeaPidFile -Value '';
|
||||||
|
$FailureTime = [DateTime]::Now;
|
||||||
Write-IcingaEventMessage -EventId 1505 -Namespace Framework -Objects ([string]::Format('{0}/5', $JeaRestartCounter));
|
Write-IcingaEventMessage -EventId 1505 -Namespace Framework -Objects ([string]::Format('{0}/5', $JeaRestartCounter));
|
||||||
Start-IcingaForWindowsDaemon -RunAsService:$RunAsService -JEAContext:$JEAContext -JEARestart;
|
Start-IcingaForWindowsDaemon -RunAsService:$RunAsService -JEAContext:$JEAContext -JEARestart;
|
||||||
|
|
||||||
$JeaRestartCounter += 1;
|
if (([DateTime]::Now - $FailureTime).TotalSeconds -lt 180) {
|
||||||
|
$JeaRestartCounter += 1;
|
||||||
|
} else {
|
||||||
|
$JeaRestartCounter = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$JeaPid = '';
|
$JeaPid = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Start-Sleep -Seconds 5;
|
Start-Sleep -Seconds 5;
|
||||||
|
$JeaAliveCounter += 1;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Start-Sleep -Seconds 100;
|
Start-Sleep -Seconds 100;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue