arisa 2.2.6 → 2.2.8
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/bin/arisa.js +11 -7
- package/package.json +1 -1
package/bin/arisa.js
CHANGED
|
@@ -580,10 +580,14 @@ function canUseSystemdSystem() {
|
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
function runArisaForeground() {
|
|
583
|
-
|
|
583
|
+
// Detach child + exit parent immediately to free parent bun memory (~50-100MB).
|
|
584
|
+
// On 1GB VPS, two bun processes trigger OOM.
|
|
585
|
+
const child = spawn("su", ["-", "arisa", "-c", `${ARISA_BUN_ENV} && export ARISA_PROJECT_DIR=${SHARED_ARISA_ROOT} && exec /home/arisa/.bun/bin/bun ${sharedDaemonEntry}`], {
|
|
584
586
|
stdio: "inherit",
|
|
587
|
+
detached: true,
|
|
585
588
|
});
|
|
586
|
-
|
|
589
|
+
child.unref();
|
|
590
|
+
process.exit(0);
|
|
587
591
|
}
|
|
588
592
|
|
|
589
593
|
// ── Root guard ──────────────────────────────────────────────────────
|
|
@@ -599,7 +603,7 @@ if (isRoot()) {
|
|
|
599
603
|
}
|
|
600
604
|
|
|
601
605
|
process.stdout.write("\nStarting interactive setup as user arisa...\n\n");
|
|
602
|
-
|
|
606
|
+
runArisaForeground(); // exits parent process internally
|
|
603
607
|
}
|
|
604
608
|
|
|
605
609
|
// Already provisioned — route commands
|
|
@@ -618,7 +622,7 @@ if (isRoot()) {
|
|
|
618
622
|
if (isDefaultInvocation) {
|
|
619
623
|
if (!isArisaConfigured()) {
|
|
620
624
|
process.stdout.write("Arisa is not configured yet. Starting interactive setup...\n\n");
|
|
621
|
-
|
|
625
|
+
runArisaForeground(); // exits parent process internally
|
|
622
626
|
}
|
|
623
627
|
if (hasSystemd) {
|
|
624
628
|
if (isSystemdActive()) {
|
|
@@ -628,13 +632,13 @@ if (isRoot()) {
|
|
|
628
632
|
}
|
|
629
633
|
}
|
|
630
634
|
// No systemd → foreground
|
|
631
|
-
|
|
635
|
+
runArisaForeground(); // exits parent process internally
|
|
632
636
|
}
|
|
633
637
|
|
|
634
638
|
switch (command) {
|
|
635
639
|
case "start":
|
|
636
640
|
if (hasSystemd) process.exit(startSystemdSystem());
|
|
637
|
-
|
|
641
|
+
runArisaForeground(); // exits parent process internally
|
|
638
642
|
break;
|
|
639
643
|
case "stop":
|
|
640
644
|
if (hasSystemd) process.exit(stopSystemdSystem());
|
|
@@ -653,7 +657,7 @@ if (isRoot()) {
|
|
|
653
657
|
break;
|
|
654
658
|
case "daemon":
|
|
655
659
|
case "run":
|
|
656
|
-
|
|
660
|
+
runArisaForeground(); // exits parent process internally
|
|
657
661
|
default:
|
|
658
662
|
process.stderr.write(`Unknown command: ${command}\n\n`);
|
|
659
663
|
printHelp();
|