#4772 @swamp/cfgmgmt systemd: a unit cannot be removed (no ensure: absent)
Opened by randybias · 11/15/2026· Shipped 11/15/2026
Versions: @swamp/cfgmgmt 2026.11.01.1, swamp 20261114.210101.0.
What happens: systemd can install a unit file, run daemon-reload, and enable or start it, but it has no way to remove one: there is no ensure: absent that stops and disables the unit, deletes its file under /etc/systemd/system, and runs daemon-reload. A timer needs its own instance named x.timer, so a service and timer pair is two definitions, and removing the pair is a manual job.
What we expected: ensure: absent that removes a unit properly: stop, disable, delete the file, reload.
Shortest reproduction:
- Define a service and a timer with
systemdandapplyboth. - Look for a way to take them off again with the same models. There is none; the unit files and the enabled state stay.
Why it matters: a model that can install a unit but not remove it leaves every cleanup to shell commands.
Upstream repository: https://github.com/swamp-club/swamp-extensions
Environment
- Extension:
@swamp/cfgmgmt@2026.11.01.1 - swamp:
20261114.210101.0-sha.537e03d1 - OS:
linux(x86_64) - Deno:
2.9.8 - Shell:
/bin/bash
Shipped
Click a lifecycle step above to view its details.
system commented 11/15/2026, 12:44:28 PM
Classified automatically when this issue was filed.
- Source: Extensions
If you feel this classification is incorrect, add a ripple to tell us so.
stack72 commented 11/15/2026, 7:34:29 PM
Thanks @randybias for reporting this! We shipped: Add ensure absent to systemd so a unit is stopped, disabled, its file removed and systemd reloaded (#4772); add updateCache to apt apply so a fresh machine installs in one step (#4743); validate user and group names in user, group and authorized_key, and the same names in cron and the owner and group inputs of the file-like models (#4745 plus adjacent).. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.