Stop AngryOxide cleanly with SIGINT #126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/angryoxide-clean-stop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
Stops AngryOxide the way it expects to be stopped, so it shuts down cleanly instead of being killed mid-write. Found by the 1.0.11-beta.2 check (#125, item 5.4: two
kismet-journalfiles left in the run folder after capture stopped).The cause. In headless mode (how Kestrel runs it), AngryOxide's only signal handler is its Ctrl-C handler, for SIGINT. On it, AngryOxide restores the adapter's MAC, closes its capture file, and has its database writer flush and commit what's queued (up to 2 s, the v0.9.4 batching). The capture service stopped it with SIGTERM: systemd's default stop signals every process in the unit, and the launcher's trap, agent relaunches and run-folder rolls all used
kill -TERM. That killed AngryOxide outright. Under v0.9.3's one-row commits a journal only existed for an instant; with batched writes a transaction is usually open, so the kill left one behind.stop_aoincapture-launch.sh: SIGINT, wait up to 10 s (PWN_AO_STOP_SECONDS), then SIGKILL, logged. It's used for an agent relaunch, a roll, and a stop; the stop trap sends SIGINT and the supervisor loop waits throughstop_ao.env --default-signal=INT, coreutils 8.31+, bookworm has 9.1). A command started with&from a non-interactive script inherits SIGINT ignored. AngryOxide's Rust handler most likely overrides that, but this doesn't depend on it.kestrel-capture.service:KillMode=mixed, so systemd's SIGTERM reaches only the launcher, and anything left after it exits is killed;TimeoutStopSec=30covers the clean stop.Checklist
make lint(ansible--syntax-check,yamllint,shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.make test(thekestrel_pipytest suite and the real-data check's tests). The Test workflow runs this on the PR..envfiles, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.docs/, and the on-device operator guide (GUIDE_MDinkestrel_pi/userguide.py) where it applies.Release impact
kestrel_pipackage,plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine'sLIB_SCRIPTS, or the CLI.config.txt/cmdline, kernel modules, the base image or partition size,builder/config.json,builder/config.yml, theMakefile,.forgejo/workflows/, a shipped config default (config.toml/default.conf), or a brand-new lib script.Notes for review
For 1.0.11-beta.3. App-layer:
capture-launchand the unit are files the updater already installs. No build input changes, so the stable release's floor stays at beta.2.Tests (
test_capture_launch.py), withstop_aorun in bash against fake processes started the way the launcher starts AngryOxide:KillMode=mixedand a stop timeout.Writing them also showed the inherited-ignore problem: a bash fake started with
&couldn't trap SIGINT until started throughenv --default-signal=INT.On the device (beta 3's check): stop capture and confirm no
kismet-journalis left, and that the journal shows AngryOxide's clean exit rather than "didn't stop within 10s".make lintis clean; the launcher tests pass (12).🤖 Generated with Claude Code