When safe_truncate cuts off \x1b[0m from a colorized log line, the
foreground color leaks onto the > prompt. Emit RESET before GRAY_BG
to ensure the input line always starts with a clean slate.
When the daemon runs as a different user (e.g. via systemd), the client
cannot read /proc/<pid>/environ due to permissions. Fall back to
parsing the cmdline for -D / --state-dir flags, which are world-readable.
Fixes 'error: no logs for <service>' when client and daemon run as
different users.
v0.1.1
socket stays in /tmp/rss/rss.sock so client commands need no extra args;
state dir is controlled by RSS_STATE_DIR or --state-dir and stores
enabled flags, logs, and daemon.pid in a persistent location.
- rss send <name> <message>: one-line command to service stdin
- rss attach <name>: interactive stdin forwarding with log tailing
- rss attach --full <name>: same but Ctrl+C sends SIGINT
- safe mode: Ctrl+C just detaches, doesn't kill the process
- Ctrl+P then D to detach
- daemon stores ChildStdin in Proc, handles streaming stdin IPC
sets SIGTERM death signal in each child before exec, so if the
daemon exits (even by crash/SIGKILL), all managed services receive
SIGTERM and terminate. adds libc dependency for prctl.
includes getppid() == 1 check to handle the fork/prctl race.
Both functions used format! with HOME for log paths; when daemon
runs as system user without HOME, logs went to /.local/share/...
Now uses state::log_path() like spawn() does.
CLI now sends enable/disable commands to the daemon via Unix
socket. The daemon validates the service against its config,
creates/removes the enabled marker, and optionally starts the
service (enable --now). CLI no longer needs config access.
- daemon: chmod socket to 0770 after bind so group devs can connect
- ipc: remove stale-socket deletion — it was deleting the socket when
connect failed due to permissions, breaking the running daemon
- runtime_dir() defaults to /tmp/rss (no user-specific fallback)
- socket_path() defaults to /tmp/rss/rss.sock (overridable via RSS_SOCKET)
- enabled markers in runtime_dir, not config_dir (shared state)
- daemon creates /tmp/rss/ with explicit 770 permissions
- socket/log/enabled paths resolved via state.rs with priority:
RSS_SOCKET/RSS_STATE_DIR/RSS_CONFIG_DIR env → XDG_RUNTIME_DIR
→ ~/.local/share/rss → /tmp/rss-niko
- config path: RSS_CONFIG → RSS_CONFIG_DIR/config.toml → ~/.config/rss
→ /etc/rss/config.toml
- removed State struct; all functions are module-level
- daemon chmods socket parent dir for group access
- clean up stale PID file on config load failure
- single daemon process manages all services in memory
- CLI communicates via Unix socket, does not read config
- config hot-reload: daemon polls config.toml, reacts immediately
- rename-safe: removing a service from config kills it, adding starts if enabled
- logs remain file-based for direct reading by rss logs
- removed per-service PID files, supervisor module simplified
- rss daemon kills and cleans services not in config (rename-safe)
- rss list also prunes orphaned state
- rss start checks for already running before spawning
- State: add supervise_dir/service_dir/list_pid_names helpers
- start/stop/restart/status/logs/enable/disable/list/daemon
- PID-file based state, no daemon, no root
- config.toml with placeholders, restart policies, env vars
- log tailing with -n/-f and stderr colorization
- supervisor per service with SIGTERM handling