diff --git a/build/Version.props b/build/Version.props index af7c24e51a..2b9c5d5073 100644 --- a/build/Version.props +++ b/build/Version.props @@ -11,7 +11,7 @@ 16.0.0 7.2.1 5.9.0 - 1.4.1 + 1.5.0 1.2.1 2.0.0 netstandard2.0 diff --git a/build/tgstation-server.service b/build/tgstation-server.service index 98c03fee57..44ce74fe2e 100644 --- a/build/tgstation-server.service +++ b/build/tgstation-server.service @@ -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 diff --git a/src/Tgstation.Server.Host.Console/Program.cs b/src/Tgstation.Server.Host.Console/Program.cs index c8383865af..26f5b8f5b5 100644 --- a/src/Tgstation.Server.Host.Console/Program.cs +++ b/src/Tgstation.Server.Host.Console/Program.cs @@ -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) diff --git a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj index 3cbf1c1a16..a405553d55 100644 --- a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj +++ b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj @@ -11,6 +11,8 @@ + +