Files
tgstation-server/_system_d_manager_8cs_source.html

297 lines
51 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tgstation-server: src/Tgstation.Server.Host/System/SystemDManager.cs Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">tgstation-server<span id="projectnumber">&#160;6.19.3</span>
</div>
<div id="projectbrief">The /tg/station 13 server suite</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_34761767c1c3cd212f9d2f80ea0828a8.html">Tgstation.Server.Host</a></li><li class="navelem"><a class="el" href="dir_3d220027e29e19c608b6d51ce3029c32.html">System</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">SystemDManager.cs</div></div>
</div><!--header-->
<div class="contents">
<a href="_system_d_manager_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System;</div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.Globalization;</div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span>System.Threading;</div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">using </span>System.Threading.Tasks;</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">using </span>Microsoft.Extensions.Hosting;</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">using </span>Microsoft.Extensions.Logging;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">using </span>Mono.Unix;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_components.html">Tgstation.Server.Host.Components</a>;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_core.html">Tgstation.Server.Host.Core</a>;</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_system.html">Tgstation.Server.Host.System</a></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>{</div>
<div class="foldopen" id="foldopen00019" data-start="{" data-end="};">
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html"> 19</a></span> <span class="keyword">sealed</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html">SystemDManager</a> : <a class="code hl_class" href="class_background_service.html">BackgroundService</a>, <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_handler.html">IRestartHandler</a>, <a class="code hl_class" href="class_i_disposable.html">IDisposable</a></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7326ada5fcd6a23c94116325b799f327"> 24</a></span> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7326ada5fcd6a23c94116325b799f327">SDNotifyWatchdog</a> = <span class="stringliteral">&quot;WATCHDOG=1&quot;</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c"> 29</a></span> readonly IHostApplicationLifetime <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55"> 34</a></span> readonly <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager.html">IInstanceManager</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">instanceManager</a>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a3e75fc86f1edc50ee9e3e4eec946ac79"> 39</a></span> readonly <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_registration.html">IRestartRegistration</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a3e75fc86f1edc50ee9e3e4eec946ac79">restartRegistration</a>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9"> 44</a></span> readonly ILogger&lt;SystemDManager&gt; <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7d5659d722a690da2b6fe6b243648f87"> 49</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7d5659d722a690da2b6fe6b243648f87">restartInProgress</a>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5c1b2e310fcb1831f6c4ac76bfdc9340"> 56</a></span> <span class="keyword">static</span> <span class="keywordtype">long</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5c1b2e310fcb1831f6c4ac76bfdc9340">GetMonotonicUsec</a>() =&gt; global::System.Diagnostics.Stopwatch.GetTimestamp(); <span class="comment">// HACK: https://github.com/dotnet/runtime/blob/v8.0.0-preview.6.23329.7/src/native/libs/System.Native/pal_time.c#L84 clock_gettime_nsec_np is an OSX only thing apparently...</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a6f58815e073d27699e473c74617f0fdc"> 65</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a6f58815e073d27699e473c74617f0fdc">SystemDManager</a>(</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> IHostApplicationLifetime <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>,</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager.html">IInstanceManager</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">instanceManager</a>,</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control.html">IServerControl</a> serverControl,</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> ILogger&lt;SystemDManager&gt; <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>)</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> this.applicationLifetime = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>));</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> this.instanceManager = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">instanceManager</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">instanceManager</a>));</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> ArgumentNullException.ThrowIfNull(serverControl);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> this.logger = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>));</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a3e75fc86f1edc50ee9e3e4eec946ac79">restartRegistration</a> = serverControl.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control.html#a35728d66030addfd5551351b8c6db942">RegisterForRestart</a>(<span class="keyword">this</span>);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> }</div>
</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="foldopen" id="foldopen00082" data-start="{" data-end="}">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#aa03bf7c23b1ca8beae299f5c358a55ee"> 82</a></span> <span class="keyword">public</span> <span class="keyword">override</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#aa03bf7c23b1ca8beae299f5c358a55ee">Dispose</a>()</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> base.Dispose();</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a3e75fc86f1edc50ee9e3e4eec946ac79">restartRegistration</a>.Dispose();</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a729a7b49b44d5f74f7dbc0d2d9c1ae7d"> 89</a></span> <span class="keyword">public</span> ValueTask <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a729a7b49b44d5f74f7dbc0d2d9c1ae7d">HandleRestart</a>(Version? updateVersion, <span class="keywordtype">bool</span> handlerMayDelayShutdownWithExtremelyLongRunningTasks, CancellationToken cancellationToken)</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// If this is set, we know a gracefule SHUTDOWN was requested</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7d5659d722a690da2b6fe6b243648f87">restartInProgress</a> = !handlerMayDelayShutdownWithExtremelyLongRunningTasks;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">return</span> ValueTask.CompletedTask;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="foldopen" id="foldopen00097" data-start="{" data-end="}">
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5aa8d815c6ce19d98874a95f0a6ecbfd"> 97</a></span> <span class="keyword">protected</span> <span class="keyword">override</span> async Task <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5aa8d815c6ce19d98874a95f0a6ecbfd">ExecuteAsync</a>(CancellationToken cancellationToken)</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">SendSDNotify</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7326ada5fcd6a23c94116325b799f327">SDNotifyWatchdog</a>))</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> {</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogDebug(<span class="stringliteral">&quot;SystemD not detected&quot;</span>);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogDebug(<span class="stringliteral">&quot;SystemD detected&quot;</span>);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>.ApplicationStarted.IsCancellationRequested)</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> InvalidOperationException(<span class="stringliteral">&quot;RunAsync called after application started!&quot;</span>);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogTrace(<span class="stringliteral">&quot;Installing lifetime handlers...&quot;</span>);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> var readyCounts = 0;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordtype">void</span> CheckReady()</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> {</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">if</span> (Interlocked.Increment(ref readyCounts) &lt; 2)</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">SendSDNotify</a>(<span class="stringliteral">&quot;READY=1&quot;</span>);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>.ApplicationStarted.Register(() =&gt; CheckReady());</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">applicationLifetime</a>.ApplicationStopping.Register(</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> () =&gt; <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">SendSDNotify</a>(</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7d5659d722a690da2b6fe6b243648f87">restartInProgress</a></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> ? $<span class="stringliteral">&quot;RELOADING=1\nMONOTONIC_USEC={GetMonotonicUsec()}&quot;</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> : <span class="stringliteral">&quot;STOPPING=1&quot;</span>));</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">try</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> await <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">instanceManager</a>.<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager.html#a4ad311358f74779a6c1f2fcba4a30578">Ready</a>.WaitAsync(cancellationToken);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> CheckReady();</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> var watchdogUsec = Environment.GetEnvironmentVariable(<span class="stringliteral">&quot;WATCHDOG_USEC&quot;</span>);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (String.IsNullOrWhiteSpace(watchdogUsec))</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogDebug(<span class="stringliteral">&quot;WATCHDOG_USEC not present, not starting watchdog loop&quot;</span>);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> var microseconds = UInt64.Parse(watchdogUsec, CultureInfo.InvariantCulture);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> var timeoutIntervalMillis = (int)(microseconds / 1000);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogDebug(<span class="stringliteral">&quot;Starting watchdog loop with interval of {timeoutInterval}ms&quot;</span>, timeoutIntervalMillis);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> </div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> var timeoutInterval = TimeSpan.FromMilliseconds(timeoutIntervalMillis);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> var nextExpectedTimeout = DateTimeOffset.UtcNow + timeoutInterval;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> var timeToNextExpectedTimeout = nextExpectedTimeout - DateTimeOffset.UtcNow;</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">while</span> (!cancellationToken.IsCancellationRequested)</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> {</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> var delayInterval = timeToNextExpectedTimeout / 2;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> await Task.Delay(delayInterval, cancellationToken);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> var notifySuccess = <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">SendSDNotify</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7326ada5fcd6a23c94116325b799f327">SDNotifyWatchdog</a>);</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> var now = DateTimeOffset.UtcNow;</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">if</span> (notifySuccess)</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> nextExpectedTimeout = now + timeoutInterval;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> timeToNextExpectedTimeout = nextExpectedTimeout - now;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">if</span> (!notifySuccess)</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogWarning(<span class="stringliteral">&quot;Missed systemd heartbeat! Expected timeout in {timeoutMs}ms...&quot;</span>, timeToNextExpectedTimeout.TotalMilliseconds);</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> }</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">catch</span> (OperationCanceledException ex)</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> {</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogTrace(ex, <span class="stringliteral">&quot;Watchdog loop cancelled!&quot;</span>);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> }</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordflow">catch</span> (<a class="code hl_class" href="class_exception.html">Exception</a> ex)</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> {</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogError(ex, <span class="stringliteral">&quot;Watchdog loop crashed!&quot;</span>);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogDebug(<span class="stringliteral">&quot;Exited watchdog loop&quot;</span>);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
<div class="foldopen" id="foldopen00182" data-start="{" data-end="}">
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11"> 182</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">SendSDNotify</a>(<span class="keywordtype">string</span> command)</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> {</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogTrace(<span class="stringliteral">&quot;Sending sd_notify {message}...&quot;</span>, command);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordtype">int</span> result;</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keywordflow">try</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> {</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> result = <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods.html">NativeMethods</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods.html#a491f8c2f0d112b0dc89d1380f1865297">sd_notify</a>(0, command);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> }</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">catch</span> (<a class="code hl_class" href="class_exception.html">Exception</a> ex)</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> {</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogInformation(ex, <span class="stringliteral">&quot;Exception attempting to invoke sd_notify!&quot;</span>);</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> }</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordflow">if</span> (result &gt; 0)</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keywordflow">if</span> (result &lt; 0)</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogError(<span class="keyword">new</span> UnixIOException(result), <span class="stringliteral">&quot;sd_notify {message} failed!&quot;</span>, command);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">logger</a>.LogTrace(<span class="stringliteral">&quot;Could not send sd_notify {message}. Socket closed!&quot;</span>, command);</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> }</div>
</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> }</div>
</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span>}</div>
<div class="ttc" id="aclass_background_service_html"><div class="ttname"><a href="class_background_service.html">BackgroundService</a></div></div>
<div class="ttc" id="aclass_exception_html"><div class="ttname"><a href="class_exception.html">Exception</a></div></div>
<div class="ttc" id="aclass_i_disposable_html"><div class="ttname"><a href="class_i_disposable.html">IDisposable</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods.html">Tgstation.Server.Host.System.NativeMethods</a></div><div class="ttdoc">Native methods used by the code.</div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_2_system_2_native_methods_8cs_source.html#l00013">NativeMethods.cs:14</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods_html_a491f8c2f0d112b0dc89d1380f1865297"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_native_methods.html#a491f8c2f0d112b0dc89d1380f1865297">Tgstation.Server.Host.System.NativeMethods.sd_notify</a></div><div class="ttdeci">static int sd_notify(int unset_environment, [MarshalAs(UnmanagedType.LPUTF8Str)] string state)</div><div class="ttdoc">See https://www.freedesktop.org/software/systemd/man/sd_notify.html.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html">Tgstation.Server.Host.System.SystemDManager</a></div><div class="ttdoc">Implements the SystemD notify service protocol.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00019">SystemDManager.cs:20</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a3e75fc86f1edc50ee9e3e4eec946ac79"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a3e75fc86f1edc50ee9e3e4eec946ac79">Tgstation.Server.Host.System.SystemDManager.restartRegistration</a></div><div class="ttdeci">readonly IRestartRegistration restartRegistration</div><div class="ttdoc">The IRestartRegistration for the SystemDManager.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00039">SystemDManager.cs:39</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a5aa8d815c6ce19d98874a95f0a6ecbfd"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5aa8d815c6ce19d98874a95f0a6ecbfd">Tgstation.Server.Host.System.SystemDManager.ExecuteAsync</a></div><div class="ttdeci">override async Task ExecuteAsync(CancellationToken cancellationToken)</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00097">SystemDManager.cs:97</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a5c1b2e310fcb1831f6c4ac76bfdc9340"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a5c1b2e310fcb1831f6c4ac76bfdc9340">Tgstation.Server.Host.System.SystemDManager.GetMonotonicUsec</a></div><div class="ttdeci">static long GetMonotonicUsec()</div><div class="ttdoc">Get the current total nanoseconds value of the CLOCK_MONOTONIC clock.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a645054dbca104fe9f1ff3bec5b1b3ce9"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a645054dbca104fe9f1ff3bec5b1b3ce9">Tgstation.Server.Host.System.SystemDManager.logger</a></div><div class="ttdeci">readonly ILogger&lt; SystemDManager &gt; logger</div><div class="ttdoc">The ILogger for the SystemDManager.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00044">SystemDManager.cs:44</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a6f58815e073d27699e473c74617f0fdc"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a6f58815e073d27699e473c74617f0fdc">Tgstation.Server.Host.System.SystemDManager.SystemDManager</a></div><div class="ttdeci">SystemDManager(IHostApplicationLifetime applicationLifetime, IInstanceManager instanceManager, IServerControl serverControl, ILogger&lt; SystemDManager &gt; logger)</div><div class="ttdoc">Initializes a new instance of the SystemDManager class.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00065">SystemDManager.cs:65</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a729a7b49b44d5f74f7dbc0d2d9c1ae7d"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a729a7b49b44d5f74f7dbc0d2d9c1ae7d">Tgstation.Server.Host.System.SystemDManager.HandleRestart</a></div><div class="ttdeci">ValueTask HandleRestart(Version? updateVersion, bool handlerMayDelayShutdownWithExtremelyLongRunningTasks, CancellationToken cancellationToken)</div><div class="ttdoc">Handle a restart of the server.A ValueTask representing the running operation.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00089">SystemDManager.cs:89</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a7326ada5fcd6a23c94116325b799f327"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7326ada5fcd6a23c94116325b799f327">Tgstation.Server.Host.System.SystemDManager.SDNotifyWatchdog</a></div><div class="ttdeci">const string SDNotifyWatchdog</div><div class="ttdoc">The sd_notify command for notifying the watchdog we are alive.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00024">SystemDManager.cs:24</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_a7d5659d722a690da2b6fe6b243648f87"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#a7d5659d722a690da2b6fe6b243648f87">Tgstation.Server.Host.System.SystemDManager.restartInProgress</a></div><div class="ttdeci">bool restartInProgress</div><div class="ttdoc">If TGS is going to restart.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00049">SystemDManager.cs:49</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_aa03bf7c23b1ca8beae299f5c358a55ee"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#aa03bf7c23b1ca8beae299f5c358a55ee">Tgstation.Server.Host.System.SystemDManager.Dispose</a></div><div class="ttdeci">override void Dispose()</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00082">SystemDManager.cs:82</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_ad4c8631cfb9779da651a22122a31613c"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ad4c8631cfb9779da651a22122a31613c">Tgstation.Server.Host.System.SystemDManager.applicationLifetime</a></div><div class="ttdeci">readonly IHostApplicationLifetime applicationLifetime</div><div class="ttdoc">The IHostApplicationLifetime for the SystemDManager.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00029">SystemDManager.cs:29</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_ae11ee32aa27a117987d833967fd14b11"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#ae11ee32aa27a117987d833967fd14b11">Tgstation.Server.Host.System.SystemDManager.SendSDNotify</a></div><div class="ttdeci">bool SendSDNotify(string command)</div><div class="ttdoc">Send a sd_notify command .</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00182">SystemDManager.cs:182</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager_html_af8ef52e625bcde892e36d5635ea5ae55"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_system_d_manager.html#af8ef52e625bcde892e36d5635ea5ae55">Tgstation.Server.Host.System.SystemDManager.instanceManager</a></div><div class="ttdeci">readonly IInstanceManager instanceManager</div><div class="ttdoc">The IInstanceManager for the SystemDManager.</div><div class="ttdef"><b>Definition</b> <a href="_system_d_manager_8cs_source.html#l00034">SystemDManager.cs:34</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager.html">Tgstation.Server.Host.Components.IInstanceManager</a></div><div class="ttdoc">For managing IInstances.</div><div class="ttdef"><b>Definition</b> <a href="_i_instance_manager_8cs_source.html#l00010">IInstanceManager.cs:11</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager_html_a4ad311358f74779a6c1f2fcba4a30578"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_components_1_1_i_instance_manager.html#a4ad311358f74779a6c1f2fcba4a30578">Tgstation.Server.Host.Components.IInstanceManager.Ready</a></div><div class="ttdeci">Task Ready</div><div class="ttdoc">Task that completes when the IInstanceManager finishes initializing.</div><div class="ttdef"><b>Definition</b> <a href="_i_instance_manager_8cs_source.html#l00015">IInstanceManager.cs:15</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_handler_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_handler.html">Tgstation.Server.Host.Core.IRestartHandler</a></div><div class="ttdoc">Handler for server restarts.</div><div class="ttdef"><b>Definition</b> <a href="_i_restart_handler_8cs_source.html#l00010">IRestartHandler.cs:11</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_registration_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_restart_registration.html">Tgstation.Server.Host.Core.IRestartRegistration</a></div><div class="ttdoc">Represents the lifetime of a IRestartHandler registration.</div><div class="ttdef"><b>Definition</b> <a href="_i_restart_registration_8cs_source.html#l00008">IRestartRegistration.cs:9</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control.html">Tgstation.Server.Host.Core.IServerControl</a></div><div class="ttdoc">Represents a service that may take an updated Host assembly and run it, stopping the current assembly...</div><div class="ttdef"><b>Definition</b> <a href="_i_server_control_8cs_source.html#l00009">IServerControl.cs:10</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control_html_a35728d66030addfd5551351b8c6db942"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_core_1_1_i_server_control.html#a35728d66030addfd5551351b8c6db942">Tgstation.Server.Host.Core.IServerControl.RegisterForRestart</a></div><div class="ttdeci">IRestartRegistration RegisterForRestart(IRestartHandler handler)</div><div class="ttdoc">Register a given handler to run before stopping the server for a restart.</div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_components_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_components.html">Tgstation.Server.Host.Components</a></div><div class="ttdef"><b>Definition</b> <a href="_channel_mapping_8cs_source.html#l00003">ChannelMapping.cs:4</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_core_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_core.html">Tgstation.Server.Host.Core</a></div><div class="ttdef"><b>Definition</b> <a href="_command_pipe_manager_8cs_source.html#l00016">CommandPipeManager.cs:17</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_system_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_system.html">Tgstation.Server.Host.System</a></div><div class="ttdef"><b>Definition</b> <a href="_assembly_information_provider_8cs_source.html#l00008">AssemblyInformationProvider.cs:9</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>