@getdial/cli 0.13.1 → 0.13.2

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.
@@ -8,20 +8,6 @@ function isSystemctlNotLoaded(err) {
8
8
  const text = stderr ? stderr.toString() : "";
9
9
  return /not loaded|does not exist|Unit .* not found/i.test(text);
10
10
  }
11
- /**
12
- * True when the error means systemd simply isn't usable here — no systemctl on
13
- * PATH, or no user session bus (sandbox / container / CI / non-systemd distro).
14
- * These are expected on many machines, so they should be logged at debug, not
15
- * dumped as a scary warning with a full stack trace.
16
- */
17
- function isSystemdUnavailable(err) {
18
- const e = err;
19
- if (e.code === "ENOENT")
20
- return true; // systemctl / loginctl not installed
21
- const stderr = e.stderr ? e.stderr.toString() : "";
22
- const text = stderr || e.message || "";
23
- return /Failed to connect to bus|No medium found|XDG_RUNTIME_DIR|not been booted with systemd|Connection refused|Permission denied/i.test(text);
24
- }
25
11
  function isEnoent(err) {
26
12
  return err.code === "ENOENT";
27
13
  }
@@ -88,11 +74,11 @@ export function systemctlStatus() {
88
74
  return { running: active, pid: active && pid > 0 ? pid : null };
89
75
  }
90
76
  catch (err) {
91
- // Expected on machines without a systemd user session stay quiet there.
92
- if (isSystemdUnavailable(err))
93
- logger.debug({ err }, "systemd not available; treating listen service as not running");
94
- else
95
- logger.warn({ err }, "systemctl show failed");
77
+ // Best-effort status probe. Any failure systemctl missing, no user session
78
+ // bus (sandbox/container/CI), unit unknown — just means "not running" for our
79
+ // purposes. Log at debug so we never dump a stack trace to a user's stderr;
80
+ // run with DIAL_LOG_LEVEL=debug to see it.
81
+ logger.debug({ err }, "systemctl show failed; treating listen service as not running");
96
82
  return { running: false, pid: null };
97
83
  }
98
84
  }
@@ -102,10 +88,8 @@ export function lingerEnabled(user) {
102
88
  return /Linger=yes/.test(out);
103
89
  }
104
90
  catch (err) {
105
- if (isSystemdUnavailable(err))
106
- logger.debug({ err, user }, "loginctl unavailable; assuming linger disabled");
107
- else
108
- logger.warn({ err, user }, "loginctl show-user failed; assuming linger disabled");
91
+ // Best-effort; debug only (see systemctlStatus). Assume linger disabled.
92
+ logger.debug({ err, user }, "loginctl show-user failed; assuming linger disabled");
109
93
  return false;
110
94
  }
111
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getdial/cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Dial CLI — install, sign up, and run the local listen service.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/skills.tar.gz CHANGED
Binary file