You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tom Tromey <tr...@creche.cygnus.com> on 1996/09/30 17:55:45 UTC

apache exit status

Right now Apache will exit with status 1 in response to the -v and -h
options.  I think it should instead exit with status 0 here.  These
exits are not errors, but are simply informational.

Also, in a script it is convenient to be able to check for Apache by
trying the -v option and bombing on failure:

	httpd -v > /dev/null 2>&1 || {
	   echo "nope"; exit 1
	}

Patch appended.

Tom
-- 
tromey@cygnus.com                 Member, League for Programming Freedom

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.72
diff -c -5 -r1.72 http_main.c
*** http_main.c	1996/09/25 20:07:50	1.72
--- http_main.c	1996/09/30 15:51:40
***************
*** 1930,1943 ****
            case 'f':
              strcpy (server_confname, optarg);
              break;
            case 'v':
              printf("Server version %s.\n",SERVER_VERSION);
!             exit(1);
            case 'h':
  	    show_directives();
! 	    exit(1);
  	  case 'X':
  	    ++one_process;	/* Weird debugging mode. */
  	    break;
            case '?':
              usage(argv[0]);
--- 1930,1943 ----
            case 'f':
              strcpy (server_confname, optarg);
              break;
            case 'v':
              printf("Server version %s.\n",SERVER_VERSION);
!             exit(0);
            case 'h':
  	    show_directives();
! 	    exit(0);
  	  case 'X':
  	    ++one_process;	/* Weird debugging mode. */
  	    break;
            case '?':
              usage(argv[0]);

Re: apache exit status

Posted by Brian Behlendorf <br...@organic.com>.
On 30 Sep 1996, Tom Tromey wrote:
> Right now Apache will exit with status 1 in response to the -v and -h
> options.  I think it should instead exit with status 0 here.  These
> exits are not errors, but are simply informational.
> 
> Also, in a script it is convenient to be able to check for Apache by
> trying the -v option and bombing on failure:
> 
> 	httpd -v > /dev/null 2>&1 || {
> 	   echo "nope"; exit 1
> 	}

+1.  This is small enough I think committing it should be uncontroversial...

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS