When pi crashes (e.g. due to EROFS or other errors), agentd's Haskell-side log reader loop continues trying to write to the closed handle. This spams journalctl with hundreds of identical 'hPutStr: illegal operation (handle is closed)' errors. Fix: detect when the pi process has exited and close/stop the log reader loop cleanly. The reader should catch the IOException from the closed handle and terminate gracefully.
Fixed in b697c45: readPiOutput/readPiStderr use IORef to track log handle health. After first write failure, all future writes are skipped. Also stops reading on broken pipe.