Run bounded OPNsense inventory and durable mTLS heartbeats as separate FreeBSD services
Rust development slice / linux (push) Failing after 11s
Rust development slice / linux (push) Failing after 11s
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
# PROVIDE: discovery_agent
|
||||
# REQUIRE: NETWORKING
|
||||
# KEYWORD: shutdown
|
||||
. /etc/rc.subr
|
||||
name=discovery_agent
|
||||
rcvar=discovery_agent_enable
|
||||
load_rc_config "$name"
|
||||
: "${discovery_agent_enable:=NO}"
|
||||
start_cmd=discovery_start
|
||||
stop_cmd=discovery_stop
|
||||
|
||||
discovery_start() {
|
||||
for part in collect agent; do
|
||||
pid=/var/run/discovery-$part.pid
|
||||
[ -z "$(check_pidfile "$pid" /usr/sbin/daemon)" ] || continue
|
||||
user=root
|
||||
[ "$part" != agent ] || user=discovery
|
||||
/usr/sbin/daemon -f -r -R 10 -P "$pid" -u "$user" -S -T "discovery-$part" \
|
||||
/usr/local/bin/python3 -I /usr/local/libexec/discovery-agent/"$part".pyz || return 1
|
||||
done
|
||||
}
|
||||
discovery_stop() {
|
||||
for part in agent collect; do
|
||||
pid=$(check_pidfile "/var/run/discovery-$part.pid" /usr/sbin/daemon)
|
||||
[ -z "$pid" ] || kill -TERM "$pid"
|
||||
done
|
||||
}
|
||||
run_rc_command "$1"
|
||||
Reference in New Issue
Block a user