diff --git a/src/Tgstation.Server.Host/System/SystemDManager.cs b/src/Tgstation.Server.Host/System/SystemDManager.cs
index a026be25fb..44ea899b3f 100644
--- a/src/Tgstation.Server.Host/System/SystemDManager.cs
+++ b/src/Tgstation.Server.Host/System/SystemDManager.cs
@@ -19,6 +19,11 @@ namespace Tgstation.Server.Host.System
///
sealed class SystemDManager : IHostedService, IRestartHandler, IDisposable
{
+ ///
+ /// The sd_notify command for notifying the watchdog we are alive.
+ ///
+ const string SDNotifyWatchdog = "WATCHDOG=1";
+
///
/// The for the .
///
@@ -104,7 +109,7 @@ namespace Tgstation.Server.Host.System
///
public Task StartAsync(CancellationToken cancellationToken)
{
- if (SendSDNotify("WATCHDOG=1"))
+ if (SendSDNotify(SDNotifyWatchdog))
{
logger.LogDebug("SystemD detected");
runTask = RunAsync(watchdogCts.Token);
@@ -176,10 +181,7 @@ namespace Tgstation.Server.Host.System
{
await Task.Delay(milliseconds, cancellationToken);
- logger.LogTrace("Sending sd_notify WATCHDOG=1");
- var result = NativeMethods.sd_notify(0, "WATCHDOG=1");
- if (result <= 0)
- logger.LogError(new UnixIOException(result), "sd_notify READY=1 failed!");
+ SendSDNotify(SDNotifyWatchdog);
}
}
catch (OperationCanceledException ex)