From d7ec0bef1c502f0ad51b0faef5027a0c481a562d Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Tue, 9 Jun 2026 03:26:21 +0200 Subject: [PATCH] fix(startup): shut down after server exit --- startup/servers.lua | 4 +++- tests/startup-servers.lua | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/startup/servers.lua b/startup/servers.lua index 0434c73..88882fe 100644 --- a/startup/servers.lua +++ b/startup/servers.lua @@ -1,4 +1,4 @@ -local _VERSION = '1.3.1' +local _VERSION = '1.3.2' local LOCAL_MANIFEST_PATH = '/trapos/manifest.json'; @@ -56,3 +56,5 @@ if #SERVERS > 0 then end parallel.waitForAll(shellFn, table.unpack(servers)); + +os.shutdown(); diff --git a/tests/startup-servers.lua b/tests/startup-servers.lua index 66cc7b8..f5dc0ea 100644 --- a/tests/startup-servers.lua +++ b/tests/startup-servers.lua @@ -5,6 +5,7 @@ local testlib = createLibTest({ ... }); local function runStartupWithStubs() local calls = { rebooted = false, + shutdown = false, shellRuns = {}, prints = {}, }; @@ -19,6 +20,9 @@ local function runStartupWithStubs() reboot = function() calls.rebooted = true; end, + shutdown = function() + calls.shutdown = true; + end, sleep = function() end, }, parallel = { @@ -54,10 +58,11 @@ local function runStartupWithStubs() return calls; end -testlib.test('shell exit does not force reboot', function() +testlib.test('shell exit shuts down without rebooting', function() local calls = runStartupWithStubs(); testlib.assertEquals(calls.shellRuns[1], 'shell'); + testlib.assertEquals(calls.shutdown, true); testlib.assertEquals(calls.rebooted, false); for _, message in ipairs(calls.prints) do testlib.assertTrue(