Python – What does process exit status 3 mean

linuxprocesspythonstatusunix

I've seen the usage of exit status 3 in several python scripts that restart processes. As far as I know the convention is only about 0 and "not 0" on Unix/Linux.

Is there a convention defining other values like 3.

Best Answer

At least in the old days, a return value of 1 generally meant a hard error and value 2 was usually reserved for problems with the command line arguments — it meant that the user had made an error, not the program. But beyond that: no, no convention; and even that slight convention was not universal. Like dashes in front of command-line arguments, which some versions of ps(1) let you omit, return codes were just convention. In general, read the docs (or the source!) to the script you're running and you then have to write error-code checking code to its specific meanings.