"Notify" the Watchdog

This commit is contained in:
ig 2023-08-24 10:03:20 +02:00
parent fc981d1019
commit 2ace3fad51
3 changed files with 5 additions and 5 deletions

View File

@ -80,7 +80,7 @@ internal static class Program
{
"Starting SaliMax".LogInfo();
Watchdog.Ready();
Watchdog.NotifyReady();
var battery48TlDevices = BatteryNodes
.Select(n => new Battery48TlDevice(BatteriesChannel, n))
@ -184,7 +184,7 @@ internal static class Program
StatusRecord RunIteration()
{
Watchdog.Alive();
Watchdog.NotifyAlive();
var t = UnixTime.Now;
var record = ReadStatus();

View File

@ -10,6 +10,6 @@ public static class Watchdog
[DllImport("libsystemd.so.0")]
private static extern Int32 sd_notify(Int32 unsetEnvironment, String state);
public static void Ready() => _ = sd_notify(0, "READY=1");
public static void Alive() => _ = sd_notify(0, "WATCHDOG=1");
public static void NotifyReady() => _ = sd_notify(0, "READY=1");
public static void NotifyAlive() => _ = sd_notify(0, "WATCHDOG=1");
}

View File

@ -58,7 +58,7 @@ public static class Units
}
else if (parent is String s)
{
csvLines.Add($"{path};{s};"); // leaf: unit
csvLines.Add($"{path};{s};"); // leaf: String
}
else if(type.IsEnum || (type.IsValueType && !type.IsNested))
{