Re:TTY-Exit: terminal exit codes for humans and machines
by pmurach on Sunday February 02, 2020 @05:43AM
(#22216315)
Exit codes are only used in the context of terminal shells. So it seems appropriate to refer to terminals. Wouldn't you agree?
[ Parent
| on HN ]
Re:TTY-Exit: terminal exit codes for humans and machines
by donio on Tuesday February 11, 2020 @10:42AM
(#22299314)
That's not the case at all. Every process produces an exit status when it terminates and many things besides interactive shells use them. Pretty much anything that runs a subprocess should retrieve the exit status to see if the child process was successful and log the failure if nothing else.
Some random examples: Automated build systems like Jenkins typically use the exit status to decide if a build task has succeeded. `make` also uses exit codes to decide if a child task has succeeded and may abort the rest of the build based on that and return an exit code itself. A local mail delivery agent like maildrop may return different exit status depending on if it's a permanent or temporary failure and the mail transfer agent decides if it should retry the local delivery based on that. The exit status of a Docker of Kubernetes container is usually based on a process exit status too.