Re: [Integrit-users] exit status
Brought to you by:
ecashin
From: Ed L C. <ec...@te...> - 2001-10-26 21:19:20
|
"Gary E. Miller" <ge...@re...> writes: > 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. Of course that's not a runtime failure. When a tool successfully does what you ask it to do, nothing failed. > > 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. That is a much stronger argument. Thank you for pointing that out -- I looked for it but couldn't find it. > 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). Hold on, now. You can already do that. Just use "-q" and "-c", and you know that if integrit generates any output, there were changes. Let's not forget that we are considering adding an unnecessary feature to integrit. That is a big deal, since now that integrit is mature, one of the most important issues is staying away from feature bloat. In light of the convention for comparative software, the idea doesn't seem as bad as I thought. I think I'll ask the folks in comp.unix.programmer. There are some gurus there that should serve as a good resource. -- --Ed Cashin PGP public key: ec...@te... http://www.terry.uga.edu/~ecashin/pgp/ |