fix(restic): use %N so the alert unit is not named .service.service #922

Merged
coilyco-ops merged 1 commit from ops/917-alert-unit-name into main 2026-08-25 05:40:22 +00:00
Owner

Cosmetic follow-up to #921, caught while verifying the rollout on ser8.

%n keeps the unit type suffix, so OnFailure=restic-failure-alert@%n.service instantiated:

restic-failure-alert@restic-prune.service.service

It works. Verified on ser8 (systemd 259): the unit resolves, %i becomes restic-prune.service, and the handler runs to status=0/SUCCESS. But the name reads like a bug to anyone who meets it in systemctl output or a journal line, which is a bad property for something only ever seen during an incident.

%N is the same specifier without the suffix. The handler passes %i to systemctl, which appends .service itself, so the script needs no change.

pre-commit run --all-files green.

🤖 Generated with Claude Code

Cosmetic follow-up to #921, caught while verifying the rollout on ser8. `%n` keeps the unit type suffix, so `OnFailure=restic-failure-alert@%n.service` instantiated: ``` restic-failure-alert@restic-prune.service.service ``` It **works**. Verified on ser8 (systemd 259): the unit resolves, `%i` becomes `restic-prune.service`, and the handler runs to `status=0/SUCCESS`. But the name reads like a bug to anyone who meets it in `systemctl` output or a journal line, which is a bad property for something only ever seen during an incident. `%N` is the same specifier without the suffix. The handler passes `%i` to `systemctl`, which appends `.service` itself, so the script needs no change. `pre-commit run --all-files` green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(restic): use %N so the alert unit is not named .service.service
All checks were successful
TruffleHog / Scan for secrets (pull_request) Successful in 5s
CI / lint (pull_request) Successful in 41s
cdc8cb5041
%n keeps the type suffix, so OnFailure=restic-failure-alert@%n.service
instantiated restic-failure-alert@restic-prune.service.service. It works
(verified on ser8, systemd 259 resolves it and the handler exits 0), but
the name reads like a bug to anyone who meets it in systemctl output.

%N is the same specifier without the suffix, giving
restic-failure-alert@restic-prune.service. The handler passes %i to
systemctl, which appends .service itself, so the script is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Agent-Role: sysadmin
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/infrastructure!922
No description provided.