"Notify" the Watchdog
This commit is contained in:
parent
fc981d1019
commit
2ace3fad51
|
@ -80,7 +80,7 @@ internal static class Program
|
||||||
{
|
{
|
||||||
"Starting SaliMax".LogInfo();
|
"Starting SaliMax".LogInfo();
|
||||||
|
|
||||||
Watchdog.Ready();
|
Watchdog.NotifyReady();
|
||||||
|
|
||||||
var battery48TlDevices = BatteryNodes
|
var battery48TlDevices = BatteryNodes
|
||||||
.Select(n => new Battery48TlDevice(BatteriesChannel, n))
|
.Select(n => new Battery48TlDevice(BatteriesChannel, n))
|
||||||
|
@ -184,7 +184,7 @@ internal static class Program
|
||||||
|
|
||||||
StatusRecord RunIteration()
|
StatusRecord RunIteration()
|
||||||
{
|
{
|
||||||
Watchdog.Alive();
|
Watchdog.NotifyAlive();
|
||||||
|
|
||||||
var t = UnixTime.Now;
|
var t = UnixTime.Now;
|
||||||
var record = ReadStatus();
|
var record = ReadStatus();
|
||||||
|
|
|
@ -10,6 +10,6 @@ public static class Watchdog
|
||||||
[DllImport("libsystemd.so.0")]
|
[DllImport("libsystemd.so.0")]
|
||||||
private static extern Int32 sd_notify(Int32 unsetEnvironment, String state);
|
private static extern Int32 sd_notify(Int32 unsetEnvironment, String state);
|
||||||
|
|
||||||
public static void Ready() => _ = sd_notify(0, "READY=1");
|
public static void NotifyReady() => _ = sd_notify(0, "READY=1");
|
||||||
public static void Alive() => _ = sd_notify(0, "WATCHDOG=1");
|
public static void NotifyAlive() => _ = sd_notify(0, "WATCHDOG=1");
|
||||||
}
|
}
|
|
@ -58,7 +58,7 @@ public static class Units
|
||||||
}
|
}
|
||||||
else if (parent is String s)
|
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))
|
else if(type.IsEnum || (type.IsValueType && !type.IsNested))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue