Live AiFw appliance shows 6 trafficcop processes running from 5 distinct start times — orphans accumulating from buggy rc.d, but defense-in-depth requires the binary itself to refuse a second invocation regardless of how it was launched.
Fix: copy the single_instance helper from AiFw (aifw-common/src/single_instance.rs — fcntl F_SETLK F_WRLCK on /var/run/trafficcop.lock) and call acquire("trafficcop") at the top of main. On AlreadyRunning(pid), print error and exit 1.
Tracking spec (in AiFw repo): docs/superpowers/specs/2026-04-26-process-hardening-and-ids-extraction-design.md
Acceptance: running trafficcop while one is already running prints trafficcop: another instance is already running (pid X) and exits 1.
Live AiFw appliance shows 6 trafficcop processes running from 5 distinct start times — orphans accumulating from buggy rc.d, but defense-in-depth requires the binary itself to refuse a second invocation regardless of how it was launched.
Fix: copy the
single_instancehelper from AiFw (aifw-common/src/single_instance.rs— fcntlF_SETLK F_WRLCKon/var/run/trafficcop.lock) and callacquire("trafficcop")at the top of main. OnAlreadyRunning(pid), print error and exit 1.Tracking spec (in AiFw repo):
docs/superpowers/specs/2026-04-26-process-hardening-and-ids-extraction-design.mdAcceptance: running trafficcop while one is already running prints
trafficcop: another instance is already running (pid X)and exits 1.