Systemd Service
@svendowideit/systemd-servicev2026.09.11.1
01README
Generic systemd user service management. Idempotently creates, starts, stops, and removes a systemd user service unit for any service name and command line. Any other extension can call its methods to stand up a persistent service — e.g. running swamp's bundled Deno to serve dynamic web services and APIs like @svendowideit/news's feedback-server.
02Models
@svendowideit/systemd-servicev2026.09.11.1systemd_service.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| denoPath | string | Path to the Deno binary used to run Deno services (defaults to swamp's bundled Deno) |
| unitDir | string | Directory where systemd user unit files are written |
fn createService(serviceName: string, command: string, description?: string, workingDirectory?: string, environment: array, restart: string, restartSec: string, after: array, wants: array, force: boolean)
Idempotently write (or update) a systemd user service unit and daemon-reload
| Argument | Type | Description |
|---|---|---|
| serviceName | string | systemd user service name (without the .service suffix) |
| command | string | Full command line the service runs (e.g. ~/.swamp/deno/deno run --allow-net scripts/feedback-server.ts) |
| description? | string | Human-readable description for the [Unit] section |
| workingDirectory? | string | Working directory for the service (WorkingDirectory=) |
| environment | array | Environment variables as KEY=VALUE strings (Environment=) |
| restart | string | Restart= policy (e.g. on-failure, always, no) |
| restartSec | string | RestartSec= delay between restarts |
| after | array | After= dependencies |
| wants | array | Wants= dependencies |
| force | boolean | Rewrite the unit file even if it already matches |
fn startService()
Start and enable a systemd user service, enable user lingering so it runs at boot, and verify it is active
fn stopService(serviceName: string)
Stop a systemd user service
| Argument | Type | Description |
|---|---|---|
| serviceName | string | systemd user service name (without the .service suffix) |
fn removeService(serviceName: string)
Stop, disable, delete the unit file, and daemon-reload for a systemd user service
| Argument | Type | Description |
|---|---|---|
| serviceName | string | systemd user service name (without the .service suffix) |
fn status()
Report active/enabled state of a systemd user service
Resources
service(infinite)— systemd user service status
create(infinite)— Last createService result
03Previous Versions
2026.09.10.1
04Stats
A
100 / 100
Downloads
0
Archive size
9.1 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
05Platforms