Re: [Integrit-users] exit status
Brought to you by:
ecashin
From: Gary E. M. <ge...@re...> - 2001-10-26 20:56:54
|
Yo Ed! On 26 Oct 2001, Ed L Cashin wrote: > integrit was written in C after the ANSI standard came out. There are > only two defined exit statuses for a C program: zero, EXIT_SUCCESS, > and EXIT_FAILURE. The tools you refer to were developed before the > ANSI standard. They are "grandfathered in". New programs, however, > must respect the conventions of the world we live in now. I agree on standards, I disagree that a file mismatch is not a FAILURE. It is a failure in that my file system has changed. > Anyway, analogies like this are not helpful. gnapster always exits > with 1 for no good reason. That doesn't mean integrit should. Gnapster is not part of POSIX, diff and cmp are POSIX standard. If we are talking standards then let us stay with standards. As long as we are on standards, how about the GNU standards: http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_547.html "There are conventions for what sorts of status values certain programs should return. The most common convention is simply 0 for success and 1 for failure. Programs that perform comparison use a different convention: they use status 1 to indicate a mismatch, and status 2 to indicate an inability to compare. Your program should follow an existing convention if an existing convention makes sense for it." Nothing about "grandfathering" in there. Now we just need to decide whether this "makes sense". I think it does make sense to return 1 on a changes a 2 on an error. That way I can sort my morning reports from CRITICAL (intergit failed), to WARNING (integrit found something) and OK (no changes or errors). RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 20340 Empire Blvd, Suite E-3, Bend, OR 97701 ge...@re... Tel:+1(541)382-8588 Fax: +1(541)382-8676 > Standards conformance is a better guideline. |