Run approved FreeBSD root jobs through independently pinned and synchronized local helper
Rust development slice / linux (push) Failing after 11s

This commit is contained in:
2026-11-20 08:27:13 +01:00
parent 2e3916b84b
commit 0b0790de71
17 changed files with 1037 additions and 61 deletions
+10 -1
View File
@@ -11,6 +11,15 @@ start_cmd=discovery_start
stop_cmd=discovery_stop
discovery_start() {
if [ -f /usr/local/etc/discovery-agent/root-policy.json ]; then
install -d -o root -g wheel -m 0700 /var/db/discovery-root-jobs || return 1
install -d -o root -g discovery -m 0750 /var/run/discovery-root-jobs || return 1
pid=/var/run/discovery-root-jobs.pid
if [ -z "$(check_pidfile "$pid" /usr/sbin/daemon)" ]; then
/usr/sbin/daemon -f -r -R 5 -P "$pid" -S -T discovery-root-jobs \
/usr/local/libexec/discovery-agent/rmm-opnsense-jobs --root-helper || return 1
fi
fi
for part in collect agent; do
pid=/var/run/discovery-$part.pid
[ -z "$(check_pidfile "$pid" /usr/sbin/daemon)" ] || continue
@@ -21,7 +30,7 @@ discovery_start() {
done
}
discovery_stop() {
for part in agent collect; do
for part in agent collect root-jobs; do
pid=$(check_pidfile "/var/run/discovery-$part.pid" /usr/sbin/daemon)
[ -z "$pid" ] || kill -TERM "$pid"
done