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
+11 -2
View File
@@ -24,13 +24,22 @@ done
if [ -x "$rc" ]; then
"$rc" onestop
for _ in 1 2 3 4 5; do
[ -f /var/run/discovery-agent.pid ] || [ -f /var/run/discovery-collect.pid ] || break
[ -f /var/run/discovery-agent.pid ] || [ -f /var/run/discovery-collect.pid ] || [ -f /var/run/discovery-root-jobs.pid ] || break
sleep 1
done
if [ -f /var/run/discovery-agent.pid ] || [ -f /var/run/discovery-collect.pid ]; then
if [ -f /var/run/discovery-agent.pid ] || [ -f /var/run/discovery-collect.pid ] || [ -f /var/run/discovery-root-jobs.pid ]; then
echo 'Existing service still running' >&2; exit 1
fi
fi
if [ -f "$src/rmm-opnsense-jobs" ]; then
install -o root -g wheel -m 0555 "$src/rmm-opnsense-jobs" "$app/jobs.next"
if [ -f "$conf/root-policy.json" ] && ! /usr/local/bin/python3 -I -c \
'import hashlib,json,sys;sys.exit(hashlib.file_digest(open(sys.argv[1],"rb"),"sha256").hexdigest()!=json.load(open(sys.argv[2]))["helper_binary_sha256"])' \
"$app/jobs.next" "$conf/root-policy.json"; then
echo 'Native helper differs from the local policy pin' >&2; "$rc" start; exit 1
fi
mv -f "$app/jobs.next" "$app/rmm-opnsense-jobs"
fi
for part in collect agent; do mv -f "$app/$part.next" "$app/$part.pyz"; done
install -o root -g wheel -m 0444 "$src/ca.pem" "$conf/ca.pem"
install -o root -g wheel -m 0555 "$src/discovery_agent" "$rc"