906948
#!/usr/bin/sh
906948
#
906948
# Licensed to the Apache Software Foundation (ASF) under one or more
906948
# contributor license agreements.  See the NOTICE file distributed with
906948
# this work for additional information regarding copyright ownership.
906948
# The ASF licenses this file to You under the Apache License, Version 2.0
906948
# (the "License"); you may not use this file except in compliance with
906948
# the License.  You may obtain a copy of the License at
906948
#
906948
#     http://www.apache.org/licenses/LICENSE-2.0
906948
#
906948
# Unless required by applicable law or agreed to in writing, software
906948
# distributed under the License is distributed on an "AS IS" BASIS,
906948
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
906948
# See the License for the specific language governing permissions and
906948
# limitations under the License.
906948
906948
###
906948
### NOTE: This is a replacement version of the "apachectl" script with
906948
### some differences in behaviour to the version distributed with
906948
### Apache httpd.  Please read the apachectl(8) man page for more
906948
### information.
906948
###
906948
906948
if [ "x$1" = "x-k" ]; then
906948
    shift
906948
fi
906948
906948
ACMD="$1"
906948
ARGV="$@"
906948
SVC='httpd.service'
906948
HTTPD='@HTTPDBIN@'
906948
906948
if [ "x$2" != "x" ] ; then
906948
    echo Passing arguments to httpd using apachectl is no longer supported.
906948
    echo You can only start/stop/restart httpd using this script.
906948
    echo To pass extra arguments to httpd, see the $SVC'(8)'
906948
    echo man page.
906948
    exit 1
906948
fi
906948
906948
case $ACMD in
906948
start|stop|restart|status)
906948
    /usr/bin/systemctl --no-pager $ACMD $SVC
906948
    ERROR=$?
906948
    ;;
906948
graceful)
906948
    if /usr/bin/systemctl -q is-active $SVC; then
906948
        /usr/bin/systemctl kill --signal=SIGUSR1 --kill-who=main $SVC
906948
    else
906948
        /usr/bin/systemctl start $SVC
906948
    fi
906948
    ERROR=$?
906948
    ;;
906948
graceful-stop)
906948
    /usr/bin/systemctl kill --signal=SIGWINCH --kill-who=main $SVC
906948
    ERROR=$?
906948
    ;;
906948
configtest|-t)
906948
    $HTTPD -t
906948
    ERROR=$?
906948
    ;;
906948
-v|-V)
906948
    $HTTPD $ACMD
906948
    ERROR=$?
906948
    ;;
906948
*)
906948
    echo apachectl: The \"$ACMD\" option is not supported. 1>&2
906948
    ERROR=2
906948
    ;;
906948
esac
906948
906948
exit $ERROR
906948