mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-10 08:37:02 +00:00
Add log_level field to NodeConfig (case-insensitive, default: info). The daemon now loads config before initializing tracing so the configured level takes effect. RUST_LOG env var still overrides if set. Remove hardcoded Environment=RUST_LOG=info from systemd units and OpenWrt procd init script — these prevented config-driven log levels from working.
28 lines
623 B
Bash
28 lines
623 B
Bash
#!/bin/sh /etc/rc.common
|
|
# FIPS mesh daemon — procd init script for OpenWrt
|
|
|
|
USE_PROCD=1
|
|
START=95
|
|
STOP=10
|
|
|
|
PROG=/usr/bin/fips
|
|
CONFIG=/etc/fips/fips.yaml
|
|
|
|
start_service() {
|
|
# Ensure TUN module is loaded before starting the daemon.
|
|
modprobe tun 2>/dev/null || true
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" --config "$CONFIG"
|
|
# Respawn: restart after 5 s, give up after 5 consecutive failures within
|
|
# a 3600 s window, then reset the failure counter and try again.
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
reload_service() {
|
|
restart
|
|
}
|