niahere 0.2.36 → 0.2.37
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/package.json +1 -1
- package/src/commands/service.ts +4 -1
- package/src/core/daemon.ts +2 -2
package/package.json
CHANGED
package/src/commands/service.ts
CHANGED
|
@@ -44,7 +44,10 @@ function buildPlist(): string {
|
|
|
44
44
|
<key>RunAtLoad</key>
|
|
45
45
|
<true/>
|
|
46
46
|
<key>KeepAlive</key>
|
|
47
|
-
<
|
|
47
|
+
<dict>
|
|
48
|
+
<key>SuccessfulExit</key>
|
|
49
|
+
<false/>
|
|
50
|
+
</dict>
|
|
48
51
|
<key>StandardOutPath</key>
|
|
49
52
|
<string>${paths.daemonLog}</string>
|
|
50
53
|
<key>StandardErrorPath</key>
|
package/src/core/daemon.ts
CHANGED
|
@@ -155,8 +155,8 @@ export async function runDaemon(): Promise<void> {
|
|
|
155
155
|
if (existingPid !== null && existingPid !== process.pid) {
|
|
156
156
|
try {
|
|
157
157
|
process.kill(existingPid, 0); // Check if alive
|
|
158
|
-
log.
|
|
159
|
-
process.exit(
|
|
158
|
+
log.debug({ existingPid, myPid: process.pid }, "another daemon is already running, exiting");
|
|
159
|
+
process.exit(0);
|
|
160
160
|
} catch {
|
|
161
161
|
// Dead PID in pidfile — safe to take over
|
|
162
162
|
}
|