orchestrating 0.1.37 → 0.1.38
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/orch +4 -0
- package/package.json +1 -1
package/bin/orch
CHANGED
|
@@ -328,6 +328,8 @@ if (firstArg === "daemon") {
|
|
|
328
328
|
</dict>
|
|
329
329
|
</dict>
|
|
330
330
|
</plist>`;
|
|
331
|
+
// Unload old plist first if it exists (avoids "Load failed" error on re-enable)
|
|
332
|
+
try { execSync(`launchctl unload "${plistPath}" 2>/dev/null`); } catch {}
|
|
331
333
|
writeFileSync(plistPath, plist);
|
|
332
334
|
execSync(`launchctl load -w "${plistPath}"`);
|
|
333
335
|
console.log("Daemon enabled — will start on login and auto-restart.");
|
|
@@ -353,6 +355,8 @@ WantedBy=default.target
|
|
|
353
355
|
`;
|
|
354
356
|
writeFileSync(servicePath, service);
|
|
355
357
|
execSync("systemctl --user daemon-reload");
|
|
358
|
+
// Stop old instance if running, then enable + start
|
|
359
|
+
try { execSync("systemctl --user stop orch-daemon.service 2>/dev/null"); } catch {}
|
|
356
360
|
execSync("systemctl --user enable --now orch-daemon.service");
|
|
357
361
|
// Enable lingering so user services run without active login session
|
|
358
362
|
try { execSync(`loginctl enable-linger ${os.userInfo().username}`); } catch {}
|