Skip to content

Install as Linux daemon #29

@Escoto

Description

@Escoto

Problem

Missing support for running as a system daemon. Users must manually start the process in a terminal and keep it alive themselves. There's no systemd unit, no system-wide install path, and the config search only looks in the user's home directory.

Proposed solution

  • Binary install to /usr/local/bin/ via a --system flag on install.sh (per-user install remains the default).
  • Layered config search chain: CLI flag > $RUSTIFYMYCLAW_CONFIG > CWD > ~/.rustifymyclaw/config.yaml > /etc/rustifymyclaw/config.yaml.
  • Systemd unit file systemd/rustifymyclaw.service with security hardening: DynamicUser=yes, NoNewPrivileges=yes, ProtectSystem=strict.

Alternatives considered

  • Daemonize in-process (double-fork, PID file): unnecessary complexity... The binary already runs correctly as a foreground process, and systemd handles supervision, restart, and logging natively.
  • /usr/bin/ can come later with .deb/.rpm packagesg.
  • Drop ~/.rustifymyclaw/ in favor of /etc/ only: per-user config is valuable for testing, and running without root. Plus standard tools (git, docker, SSH) use a simmilar approach.

Additional context

The signal handling and graceful shutdown (SIGTERM, 30s drain) already work... so, this is purely install/config/packaging infra.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions