Fix entry respawn signal forwarding

Fixes #931
This commit is contained in:
Roshan Singh
2026-01-15 06:08:21 +00:00
committed by Peter Steinberger
parent 6bcb89cf38
commit d9f2ee40f7
4 changed files with 209 additions and 31 deletions

View File

@@ -0,0 +1,19 @@
import http from "node:http";
const server = http.createServer((_, res) => {
res.writeHead(200, { "content-type": "text/plain" });
res.end("ok");
});
server.listen(0, "127.0.0.1", () => {
const addr = server.address();
if (!addr || typeof addr === "string") throw new Error("unexpected address");
process.stdout.write(`${addr.port}\n`);
});
const shutdown = (): void => {
server.close(() => process.exit(0));
};
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);