Skip to main content

Systemd Service

@svendowideit/systemd-servicev2026.09.11.1· 1d agoMODELS
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.

02Models1
@svendowideit/systemd-servicev2026.09.11.1systemd_service.ts

Global Arguments

ArgumentTypeDescription
denoPathstringPath to the Deno binary used to run Deno services (defaults to swamp's bundled Deno)
unitDirstringDirectory 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
ArgumentTypeDescription
serviceNamestringsystemd user service name (without the .service suffix)
commandstringFull command line the service runs (e.g. ~/.swamp/deno/deno run --allow-net scripts/feedback-server.ts)
description?stringHuman-readable description for the [Unit] section
workingDirectory?stringWorking directory for the service (WorkingDirectory=)
environmentarrayEnvironment variables as KEY=VALUE strings (Environment=)
restartstringRestart= policy (e.g. on-failure, always, no)
restartSecstringRestartSec= delay between restarts
afterarrayAfter= dependencies
wantsarrayWants= dependencies
forcebooleanRewrite 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
ArgumentTypeDescription
serviceNamestringsystemd 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
ArgumentTypeDescription
serviceNamestringsystemd 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 Versions1
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