@dinoxx/dinox-cli 2.16.0 → 2.16.1

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.
@@ -186,6 +186,10 @@ export async function getDaemonInfo(timeoutMs) {
186
186
  ? info.runtimeConfigFingerprint
187
187
  : null,
188
188
  authenticated: info.authenticated === true,
189
+ // Decides whether status, stop and restart go through the login service.
190
+ supervisor: info.supervisor === 'launchd' || info.supervisor === 'systemd' || info.supervisor === 'schtasks'
191
+ ? info.supervisor
192
+ : null,
189
193
  };
190
194
  }
191
195
  return null;
@@ -328,6 +328,10 @@ export async function restartDaemonLocked(port = DEFAULT_DAEMON_PORT, options =
328
328
  await service.restart();
329
329
  if (service.kind === 'schtasks')
330
330
  await requestDaemonShutdown(info.instanceId, 2_000);
331
+ // The old instance may still answer pings, and it would pass the freshness check.
332
+ if (!await waitForDaemonExit(info.instanceId, DAEMON_STOP_TIMEOUT_MS)) {
333
+ throw new DinoxError('The service did not stop the previous daemon', { code: 'DAEMON_START_FAILED' });
334
+ }
331
335
  const ready = await waitForFreshDaemon(expected.version, expected.userId, expected.tokenFingerprint, expected.runtimeConfigFingerprint, DAEMON_SERVICE_READY_TIMEOUT_MS);
332
336
  if (!ready)
333
337
  throw new DinoxError('Restarted service did not become ready', { code: 'DAEMON_START_FAILED' });
@@ -171,11 +171,11 @@ class LaunchdService {
171
171
  throw failed(this.kind, 'bootout', result);
172
172
  }
173
173
  async restart() {
174
- if (!(await this.isLoaded()))
175
- await this.bootstrap();
176
- const result = await this.run('launchctl', ['kickstart', '-k', this.target]);
177
- if (result.code !== 0)
178
- throw failed(this.kind, 'kickstart', result);
174
+ // Not `kickstart -k`: within ThrottleInterval of the last launch it blocks
175
+ // until the throttle ends (up to 30s). A fresh bootstrap starts at once.
176
+ if (await this.isLoaded())
177
+ await this.stop();
178
+ await this.bootstrap();
179
179
  }
180
180
  async uninstall() {
181
181
  const installed = this.isInstalled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinoxx/dinox-cli",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "Dinox CLI",
5
5
  "main": "dist/dinox.js",
6
6
  "scripts": {