Merge #932 (pr/sigterm-shutdown)
This commit is contained in:
commit
77aefa2bf3
|
|
@ -323,6 +323,16 @@ internal static partial class Program
|
|||
VideoOutExports.NotifyHostInterrupt();
|
||||
};
|
||||
Console.CancelKeyPress += cancelHandler;
|
||||
// SIGTERM (launchd, process managers, `kill`) takes the same cooperative shutdown: the
|
||||
// runtime's default exits with GPU work in flight, which leaves the host driver to reclaim
|
||||
// resources the device still owns.
|
||||
using var terminateRegistration = OperatingSystem.IsWindows()
|
||||
? null
|
||||
: PosixSignalRegistration.Create(PosixSignal.SIGTERM, context =>
|
||||
{
|
||||
context.Cancel = true;
|
||||
VideoOutExports.NotifyHostInterrupt();
|
||||
});
|
||||
|
||||
Console.Error.WriteLine($"[DEBUG] Running: {ebootPath}");
|
||||
result = runtime.Run(ebootPath);
|
||||
|
|
|
|||
Loading…
Reference in New Issue