[Unit] Description=Bee: schedule startup hardware audit via task queue # Start AFTER bee-web, not before — bee-web must not wait for audit. After=bee-web.service Wants=bee-web.service [Service] Type=oneshot RemainAfterExit=yes # Wait up to 90s for bee-web to respond on /healthz, then sleep 60s for # the system to settle (GPU drivers, sensors), then enqueue the audit as # a background task so it appears in the task list and logs. ExecStart=/bin/sh -c '\ i=0; \ while [ $i -lt 90 ]; do \ if curl -sf http://localhost/healthz >/dev/null 2>&1; then break; fi; \ sleep 1; i=$((i+1)); \ done; \ sleep 60; \ curl -sf -X POST http://localhost/api/audit/run >/dev/null' StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target