using System.Runtime.InteropServices; namespace InnovEnergy.App.SaliMax; // https://www.freedesktop.org/software/systemd/man/sd_notify.html public static class Watchdog { // "it is generally recommended to ignore the return value of this call. " [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"); }