lianrouter 2.3.7 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +11 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ var package_default;
|
|
|
17
17
|
var init_package = __esm(() => {
|
|
18
18
|
package_default = {
|
|
19
19
|
name: "lianrouter",
|
|
20
|
-
version: "2.3.
|
|
20
|
+
version: "2.3.9",
|
|
21
21
|
description: "LianRouter launcher: install, run and control the gateway from one command",
|
|
22
22
|
type: "module",
|
|
23
23
|
bin: {
|
|
@@ -2323,11 +2323,13 @@ function installShutdownHandlers(shutdown, exit) {
|
|
|
2323
2323
|
};
|
|
2324
2324
|
process.on("SIGINT", onSignal);
|
|
2325
2325
|
process.on("SIGTERM", onSignal);
|
|
2326
|
+
process.on("SIGHUP", onSignal);
|
|
2326
2327
|
return {
|
|
2327
2328
|
run,
|
|
2328
2329
|
dispose() {
|
|
2329
2330
|
process.off("SIGINT", onSignal);
|
|
2330
2331
|
process.off("SIGTERM", onSignal);
|
|
2332
|
+
process.off("SIGHUP", onSignal);
|
|
2331
2333
|
}
|
|
2332
2334
|
};
|
|
2333
2335
|
}
|
|
@@ -3533,7 +3535,7 @@ async function run(argv) {
|
|
|
3533
3535
|
case "status":
|
|
3534
3536
|
return await printStatus(supervisor);
|
|
3535
3537
|
case "stop":
|
|
3536
|
-
return await stopServer(supervisor);
|
|
3538
|
+
return await stopServer(supervisor, runtime.installRoot);
|
|
3537
3539
|
case "start":
|
|
3538
3540
|
return await withShutdownHandlers(supervisor, runtime, () => runInteractive(supervisor, options, runtime), embeddedDatabase);
|
|
3539
3541
|
case "tray":
|
|
@@ -3585,14 +3587,18 @@ async function printStatus(supervisor) {
|
|
|
3585
3587
|
await supervisor.dispose();
|
|
3586
3588
|
return 0;
|
|
3587
3589
|
}
|
|
3588
|
-
async function stopServer(supervisor) {
|
|
3590
|
+
async function stopServer(supervisor, installRoot) {
|
|
3591
|
+
const trayWasRunning = await isTrayRunning(installRoot);
|
|
3592
|
+
if (trayWasRunning) {
|
|
3593
|
+
await stopTray(installRoot);
|
|
3594
|
+
}
|
|
3589
3595
|
const adopted = await supervisor.adoptExisting();
|
|
3590
3596
|
if (!adopted) {
|
|
3591
3597
|
console.log("LianRouter is not running.");
|
|
3592
3598
|
return 0;
|
|
3593
3599
|
}
|
|
3594
3600
|
const status = await supervisor.stop();
|
|
3595
|
-
console.log(status.state === "stopped" ?
|
|
3601
|
+
console.log(status.state === "stopped" ? `LianRouter stopped${trayWasRunning ? " (tray closed)" : ""}.` : `Stop failed: ${status.lastError ?? status.state}`);
|
|
3596
3602
|
await supervisor.dispose();
|
|
3597
3603
|
return 0;
|
|
3598
3604
|
}
|
|
@@ -3863,6 +3869,7 @@ async function enterTrayMode(supervisor, options, runtime) {
|
|
|
3863
3869
|
await shutdownSession(session, supervisor);
|
|
3864
3870
|
return 1;
|
|
3865
3871
|
}
|
|
3872
|
+
supervisor.detach();
|
|
3866
3873
|
if (options.noOpen) {
|
|
3867
3874
|
console.log(`Tray host started; control port ${session.control.port}`);
|
|
3868
3875
|
}
|