Move SystemD arg responsibility from service to Host Watchdog

This commit is contained in:
Jordan Dominion
2024-08-31 21:32:39 -04:00
parent 213d9e9ea4
commit c5341b4471
4 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<TgsClientVersion>16.0.0</TgsClientVersion>
<TgsDmapiVersion>7.2.1</TgsDmapiVersion>
<TgsInteropVersion>5.9.0</TgsInteropVersion>
<TgsHostWatchdogVersion>1.4.1</TgsHostWatchdogVersion>
<TgsHostWatchdogVersion>1.5.0</TgsHostWatchdogVersion>
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
<TgsMigratorVersion>2.0.0</TgsMigratorVersion>
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
+1 -1
View File
@@ -11,7 +11,7 @@ User=tgstation-server
Type=notify-reload
NotifyAccess=all
WorkingDirectory=/opt/tgstation-server
ExecStart=/usr/bin/dotnet Tgstation.Server.Host.Console.dll --appsettings-base-path=/etc/tgstation-server --General:SetupWizardMode=Never --Internal:UsingSystemD=true
ExecStart=/usr/bin/dotnet Tgstation.Server.Host.Console.dll --appsettings-base-path=/etc/tgstation-server --General:SetupWizardMode=Never
TimeoutStartSec=600
Restart=always
KillMode=process
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting.Systemd;
using Microsoft.Extensions.Logging;
using Tgstation.Server.Common;
@@ -44,6 +46,11 @@ namespace Tgstation.Server.Host.Console
var trace = arguments.Remove("--trace-host-watchdog");
var debug = arguments.Remove("--debug-host-watchdog");
const string SystemDArg = "--Internal:UsingSystemD=true";
if (!arguments.Any(arg => arg.Equals(SystemDArg, StringComparison.OrdinalIgnoreCase))
&& SystemdHelpers.IsSystemdService())
arguments.Add(SystemDArg);
using var loggerFactory = LoggerFactory.Create(builder =>
{
if (trace)
@@ -11,6 +11,8 @@
</PropertyGroup>
<ItemGroup>
<!-- Usage: Identifying if we're running under SystemD -->
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
<!-- Usage: Console logging plugin -->
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
</ItemGroup>