Add persistent service jobs (-s flag)
Some checks failed
CI / shellcheck (push) Failing after 19s

Introduces a new job type for long-running systemd user services alongside
the existing timer-based jobs. Services use Type=simple with Restart=on-failure
and WantedBy=default.target — no .timer unit is created.

- New -s flag creates a service job; mutually exclusive with -t/-i/-m/-o
- Service jobs tagged with # SYSTAB_TYPE=service in their unit file
- enable/disable (-E/-D) start/stop the service in addition to toggling
  the enabled state, mirroring timer behaviour
- -S status shows ActiveState/SubState from systemd directly (avoids
  false "Inactive" for services in activating state)
- -L logs, -e edit mode, -D/-E disable/enable all handle service jobs
- Edit mode represents service jobs with 'service' as the schedule column
  (e.g. new:s,n=name | service | /path/to/cmd)
- daemon-reload runs before enable/start during service creation so
  systemd registers the new unit file first
- 22 new tests covering unit file contents, active state, disable/enable,
  named services, edit mode representation, and flag conflict errors
- New demo/services.tape and regenerated demo GIFs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthias Johnson 2026-02-24 01:00:07 -07:00
parent 2b75547726
commit 164087ab22
8 changed files with 514 additions and 109 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 KiB

After

Width:  |  Height:  |  Size: 948 KiB

Before After
Before After