Closed kke closed 5 years ago
As a CLI tool, it would make sense for pharos-cluster
to just silently exit on SIGPIPE/EPIPE.
Seems like the ruby default is to ignore SIGPIPE and rise EPIPE from syscalls instead. Looks like the default system behavior of killing the process on SIGPIPE can be explicitly restored using Signal.trap("SIGPIPE", "SYSTEM_DEFAULT")
: https://stackoverflow.com/questions/1807355/broken-pipe-errnoepipe/30103307#30103307 (sadly not the most-upvoted answer)
Kontena-cli does not do this, I think I may have fixed it somehow intentionally at some point.
IMO Signal.trap("SIGPIPE", "SYSTEM_DEFAULT")
would be better than rescue Errno::EPIPE => abort
, but the result should be more or less the same.
Fixed by #602
Same with
grep -q
(and probably anything that breaks the pipe):