Watch Stonks from Idunn
This commit is contained in:
parent
2518dc0b10
commit
9988c430f0
5 changed files with 35 additions and 3 deletions
2
scripts/health-stonks.cmd
Normal file
2
scripts/health-stonks.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
curl.exe -fsS http://127.0.0.1:8802/health >NUL
|
||||
2
scripts/restart-stonks.cmd
Normal file
2
scripts/restart-stonks.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-stonks.ps1
|
||||
21
scripts/restart-stonks.ps1
Normal file
21
scripts/restart-stonks.ps1
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$stonksRoot = "E:\Projects\Stonks"
|
||||
$stateDir = Join-Path $stonksRoot "scratch\stonks"
|
||||
$pidPath = Join-Path $stateDir "stonks.pid"
|
||||
$startScript = Join-Path $stonksRoot "scripts\start-stonks.ps1"
|
||||
|
||||
if (Test-Path -LiteralPath $pidPath) {
|
||||
$pidText = (Get-Content -LiteralPath $pidPath -Raw).Trim()
|
||||
if ($pidText -match "^\d+$") {
|
||||
$process = Get-Process -Id ([int] $pidText) -ErrorAction SilentlyContinue
|
||||
if ($null -ne $process) {
|
||||
Stop-Process -Id $process.Id -Force
|
||||
Start-Sleep -Milliseconds 500
|
||||
}
|
||||
}
|
||||
Remove-Item -LiteralPath $pidPath -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $startScript
|
||||
exit $LASTEXITCODE
|
||||
|
|
@ -39,6 +39,13 @@ $watchdogs = @(
|
|||
Health = "$repoRoot\scripts\health-mimir-eve-dashboard.cmd"
|
||||
Restart = $null
|
||||
},
|
||||
[pscustomobject]@{
|
||||
Id = "stonks"
|
||||
Name = "Stonks market pulse"
|
||||
Verse = "starfire.local"
|
||||
Health = "$repoRoot\scripts\health-stonks.cmd"
|
||||
Restart = "$repoRoot\scripts\restart-stonks.cmd"
|
||||
},
|
||||
[pscustomobject]@{
|
||||
Id = "nightwing-gjallar"
|
||||
Name = "Nightwing Gjallar framebuffer compositor"
|
||||
|
|
|
|||
|
|
@ -73,9 +73,9 @@ Install the local Starfire boot watchdogs:
|
|||
.\scripts\install-idunn-startup.ps1
|
||||
```
|
||||
|
||||
That task starts Idunn loops for Odin and the Nightwing display services at
|
||||
user logon. The current Mimir dashboard is observed but not restarted until its
|
||||
restart authority is named.
|
||||
That task starts Idunn loops for Odin, Stonks, and the Nightwing display
|
||||
services at user logon. The current Mimir dashboard is observed but not
|
||||
restarted until its restart authority is named.
|
||||
|
||||
To record a failed health check and request a restart without actuating:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue