Implement runit support for Fenris monitoring (issue #84)
Deliver end-to-end native monitoring path under runit with existing CLI/TUI controls and truthful status, preserving systemd behavior. Changes: - Add init system abstraction layer (src/fenris/init_system.py) that detects systemd vs runit and provides unified interface for timer control, on-demand collection, and service state queries - Create runit service files (units/runit/) with completion-relative 5-minute cadence, 2-minute boot delay, bounded execution (90s), no catch-up, and serialized runs via flock - Update monitor.py to use abstraction layer instead of direct systemctl - Update status.py to use abstraction layer for service state queries - Update all packaging scripts (deb, rpm) for init-system-aware setup - Update Makefile to install runit service files alongside systemd units - Add 46 tests for init system abstraction layer Spec: ADR 0008, §8.4, §8.5, §8.6, §8.7, §8.8 Closes #84 Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This commit is contained in:
co-authored by
CommandCodeBot
parent
37a0ed7030
commit
e27052d09a
@@ -93,6 +93,12 @@ install: check-python check-smartctl dist/fenris-*.whl
|
||||
@sudo install -m 0644 units/fenris-collect.service $(UNIT_DIR)/
|
||||
@sudo systemctl daemon-reload
|
||||
|
||||
@echo "=== Installing runit service files (dormant — not enabled) ==="
|
||||
@sudo install -d -m 0755 /etc/sv/fenris-collect/log
|
||||
@sudo install -m 0755 units/runit/fenris-collect/run /etc/sv/fenris-collect/run
|
||||
@sudo install -m 0755 units/runit/fenris-collect/log/run /etc/sv/fenris-collect/log/run
|
||||
@sudo touch /etc/sv/fenris-collect/down
|
||||
|
||||
@echo "=== Installing polkit policy ==="
|
||||
@sudo install -m 0644 polkit/com.bongbetic.fenris.monitor.policy $(POLKIT_DIR)/
|
||||
|
||||
@@ -143,6 +149,9 @@ upgrade: dist/fenris-*.whl
|
||||
@echo "=== Syncing units against manifest ==="
|
||||
@sudo install -m 0644 units/fenris-collect.timer $(UNIT_DIR)/
|
||||
@sudo install -m 0644 units/fenris-collect.service $(UNIT_DIR)/
|
||||
@sudo install -d -m 0755 /etc/sv/fenris-collect/log
|
||||
@sudo install -m 0755 units/runit/fenris-collect/run /etc/sv/fenris-collect/run
|
||||
@sudo install -m 0755 units/runit/fenris-collect/log/run /etc/sv/fenris-collect/log/run
|
||||
@sudo install -m 0644 polkit/com.bongbetic.fenris.monitor.policy $(POLKIT_DIR)/
|
||||
@sudo install -m 0755 scripts/fenris $(BIN_DIR)/fenris
|
||||
@sudo install -m 0755 src/fenris/monitor.py $(LIBEXEC_DIR)/fenris-monitor
|
||||
@@ -196,6 +205,9 @@ uninstall:
|
||||
@sudo systemctl stop fenris-collect.timer 2>/dev/null || true
|
||||
@sudo systemctl disable fenris-collect.timer 2>/dev/null || true
|
||||
@sudo systemctl daemon-reload
|
||||
@-sudo rm -f /var/service/fenris-collect 2>/dev/null || true
|
||||
@-sudo rm -rf /etc/sv/fenris-collect 2>/dev/null || true
|
||||
@-sudo rm -rf /var/log/fenris-collect 2>/dev/null || true
|
||||
|
||||
@echo "=== Removing installed files (preserving config and store) ==="
|
||||
@-rm -f $(BIN_DIR)/fenris
|
||||
|
||||
Reference in New Issue
Block a user