feat(systemd): add ttheart.service unit file #189

Merged
fuzzy merged 2 commits from feature/create-systemd-service into main 2026-07-06 08:53:47 +00:00
Owner

What

Create ttheart.service systemd unit file:

  • Type=simple for foreground process
  • User/Group=ttheart:ttheart for privilege separation (#87)
  • WorkingDirectory=/etc/ttheart for config discovery (#86)
  • ExecStart=/usr/local/bin/ttheart -config /etc/ttheart/config.yaml (#85)
  • Restart=on-failure with RestartSec=5 (#88)
  • EnvironmentFile=-/etc/ttheart/environment for optional env vars (#89)
  • Starts after network.target

Why

Production deployment target. Operators can install the binary, drop in this unit file, and manage via systemctl.

Testing

  • Unit tests pass — N/A (non-code file)
  • Integration tests pass — N/A
  • Manual testing performed — pre-commit pass, YAML validation passes
  • New tests added for new functionality — N/A

Breaking Changes

None.

Notes

  • Environment file is optional (prefix - means systemd won't fail if missing)
  • Config path assumes /etc/ttheart/ directory structure from #95 (config file discovery)

Closes #90
Closes #85
Closes #86
Closes #87
Closes #88
Closes #89

## What Create `ttheart.service` systemd unit file: - `Type=simple` for foreground process - `User/Group=ttheart:ttheart` for privilege separation (#87) - `WorkingDirectory=/etc/ttheart` for config discovery (#86) - `ExecStart=/usr/local/bin/ttheart -config /etc/ttheart/config.yaml` (#85) - `Restart=on-failure` with `RestartSec=5` (#88) - `EnvironmentFile=-/etc/ttheart/environment` for optional env vars (#89) - Starts after `network.target` ## Why Production deployment target. Operators can install the binary, drop in this unit file, and manage via `systemctl`. ## Testing - [ ] Unit tests pass — N/A (non-code file) - [ ] Integration tests pass — N/A - [x] Manual testing performed — pre-commit pass, YAML validation passes - [ ] New tests added for new functionality — N/A ## Breaking Changes None. ## Notes - Environment file is optional (prefix `-` means systemd won't fail if missing) - Config path assumes `/etc/ttheart/` directory structure from #95 (config file discovery) Closes #90 Closes #85 Closes #86 Closes #87 Closes #88 Closes #89
- Systemd service with simple type
- Runs as ttheart:ttheart user/group
- WorkingDirectory set to /etc/ttheart
- Restart on-failure with 5s delay
- EnvironmentFile for secrets via env vars

Closes #85
Closes #86
Closes #87
Closes #88
Closes #89
docs: mark Create systemd service file tasks as complete
All checks were successful
CI / Lint (golangci-lint) (pull_request) Successful in 1m34s
CI / Pre-commit Hooks (pull_request) Successful in 2m48s
CI / Test (pull_request) Successful in 1m31s
CI / Lint (golangci-lint) (push) Successful in 1m26s
CI / Pre-commit Hooks (push) Successful in 2m45s
CI / Test (push) Successful in 1m21s
d666e6ba32
Closes #90
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 08:47:07 +00:00
the.auditor left a comment

Review

Clean systemd unit file. Standard production service configuration.

Verified: Types=simple, User/Group separation, WorkingDirectory, Restart=on-failure with RestartSec=5, optional EnvironmentFile with - prefix, network.target dependency, multi-user.target install target.

Note: -config flag doesn't exist in current binary — it will be added in the config discovery PR (#95). The WorkingDirectory=/etc/ttheart provides a functional fallback today (binary falls back to config.yaml in CWD).

No blocking issues.

APPROVED

## Review Clean systemd unit file. Standard production service configuration. **Verified**: Types=simple, User/Group separation, WorkingDirectory, Restart=on-failure with RestartSec=5, optional EnvironmentFile with `-` prefix, network.target dependency, multi-user.target install target. **Note**: `-config` flag doesn't exist in current binary — it will be added in the config discovery PR (#95). The `WorkingDirectory=/etc/ttheart` provides a functional fallback today (binary falls back to `config.yaml` in CWD). **No blocking issues.** **APPROVED**
fuzzy merged commit d666e6ba32 into main 2026-07-06 08:53:47 +00:00
fuzzy deleted branch feature/create-systemd-service 2026-07-06 08:53:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
thwap/ttheart!189
No description provided.