(deps: SystemdManagerDeps)
| 202 | } |
| 203 | |
| 204 | async function assertUserSystemdAvailable(deps: SystemdManagerDeps): Promise<void> { |
| 205 | const probe = await deps.execSystemctl(['show-environment']); |
| 206 | if (probe.code === 0) return; |
| 207 | |
| 208 | throw new ServiceUnavailableError( |
| 209 | 'linux', |
| 210 | `systemd --user is not available in this environment: ${detail(probe) ?? 'systemctl --user show-environment failed'}.`, |
| 211 | ); |
| 212 | } |
| 213 | |
| 214 | function writeUnit(unitPath: string, plan: InstallPlan): void { |
| 215 | const text = buildSystemdUnit({ |
no test coverage detected