bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / support / apachectl
1 #!/bin/sh
2 #
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements.  See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License.  You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 #
19 # Apache control script designed to allow an easy command line interface
20 # to controlling Apache.  Written by Marc Slemko, 1997/08/23
21
22 # The exit codes returned are:
23 #   XXX this doc is no longer correct now that the interesting
24 #   XXX functions are handled by httpd
25 #       0 - operation completed successfully
26 #       1 - 
27 #       2 - usage error
28 #       3 - httpd could not be started
29 #       4 - httpd could not be stopped
30 #       5 - httpd could not be started during a restart
31 #       6 - httpd could not be restarted during a restart
32 #       7 - httpd could not be restarted during a graceful restart
33 #       8 - configuration syntax error
34 #
35 # When multiple arguments are given, only the error from the _last_
36 # one is reported.  Run "apachectl help" for usage info
37 #
38 ARGV="$@"
39 #
40 # |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||
41 # --------------------                              --------------------
42
43 # the path to your httpd binary, including options if necessary
44 HTTPD='/bottlenecks/rubbos/app/apache2/bin/httpd'
45 #
46 # pick up any necessary environment variables
47 if test -f /bottlenecks/rubbos/app/apache2/bin/envvars; then
48   . /bottlenecks/rubbos/app/apache2/bin/envvars
49 fi
50 #
51 # a command that outputs a formatted text version of the HTML at the
52 # url given on the command line.  Designed for lynx, however other
53 # programs may work.  
54 LYNX="lynx -dump"
55 #
56 # the URL to your server's mod_status status page.  If you do not
57 # have one, then status and fullstatus will not work.
58 STATUSURL="http://localhost:80/server-status"
59 #
60 # Set this variable to a command that increases the maximum
61 # number of file descriptors allowed per child process. This is
62 # critical for configurations that use many file descriptors,
63 # such as mass vhosting, or a multithreaded server.
64 ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
65 # --------------------                              --------------------
66 # ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||
67
68 # Set the maximum number of file descriptors allowed per child process.
69 if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then
70     $ULIMIT_MAX_FILES
71 fi
72
73 ERROR=0
74 if [ "x$ARGV" = "x" ] ; then 
75     ARGV="-h"
76 fi
77
78 case $ARGV in
79 start|stop|restart|graceful)
80     $HTTPD -k $ARGV
81     ERROR=$?
82     ;;
83 startssl|sslstart|start-SSL)
84     $HTTPD -k start -DSSL
85     ERROR=$?
86     ;;
87 configtest)
88     $HTTPD -t
89     ERROR=$?
90     ;;
91 status)
92     $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
93     ;;
94 fullstatus)
95     $LYNX $STATUSURL
96     ;;
97 *)
98     $HTTPD $ARGV
99     ERROR=$?
100 esac
101
102 exit $ERROR
103