576df0
diff --git a/docs/man/apachectl.8 b/docs/man/apachectl.8
576df0
index 870a048..32d3ee5 100644
576df0
--- a/docs/man/apachectl.8
576df0
+++ b/docs/man/apachectl.8
576df0
@@ -74,7 +74,7 @@ Restarts the Apache httpd daemon\&. If the daemon is not running, it is started\
576df0
 Displays a full status report from mod_status\&. For this to work, you need to have mod_status enabled on your server and a text-based browser such as \fBlynx\fR available on your system\&. The URL used to access the status report can be set by editing the \fBSTATUSURL\fR variable in the script\&.  
576df0
 .TP
576df0
 \fBstatus\fR
576df0
-Displays a brief status report\&. Similar to the \fBfullstatus\fR option, except that the list of requests currently being served is omitted\&.  
576df0
+Displays a brief status report using systemd\&.
576df0
 .TP
576df0
 \fBgraceful\fR
576df0
 Gracefully restarts the Apache httpd daemon\&. If the daemon is not running, it is started\&. This differs from a normal restart in that currently open connections are not aborted\&. A side effect is that old log files will not be closed immediately\&. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them\&. This command automatically checks the configuration files as in \fBconfigtest\fR before initiating the restart to make sure Apache doesn't die\&. This is equivalent to \fBapachectl -k graceful\fR\&.  
576df0
diff --git a/support/apachectl.in b/support/apachectl.in
576df0
index 3281c2e..8ce6f2b 100644
576df0
--- a/support/apachectl.in
576df0
+++ b/support/apachectl.in
576df0
@@ -44,19 +44,20 @@ ARGV="$@"
576df0
 # the path to your httpd binary, including options if necessary
576df0
 HTTPD='@exp_sbindir@/@progname@'
576df0
 #
576df0
-# pick up any necessary environment variables
576df0
-if test -f @exp_sbindir@/envvars; then
576df0
-  . @exp_sbindir@/envvars
576df0
-fi
576df0
 #
576df0
 # a command that outputs a formatted text version of the HTML at the
576df0
 # url given on the command line.  Designed for lynx, however other
576df0
 # programs may work.  
576df0
-LYNX="@LYNX_PATH@ -dump"
576df0
+if [ -x "@LYNX_PATH@" ]; then
576df0
+  LYNX="@LYNX_PATH@ -dump"
576df0
+else
576df0
+  LYNX=none
576df0
+fi
576df0
 #
576df0
 # the URL to your server's mod_status status page.  If you do not
576df0
 # have one, then status and fullstatus will not work.
576df0
 STATUSURL="http://localhost:@PORT@/server-status"
576df0
+
576df0
 #
576df0
 # Set this variable to a command that increases the maximum
576df0
 # number of file descriptors allowed per child process. This is
576df0
@@ -76,9 +77,46 @@ if [ "x$ARGV" = "x" ] ; then
576df0
     ARGV="-h"
576df0
 fi
576df0
 
576df0
+function checklynx() {
576df0
+if [ "$LYNX" = "none" ]; then
576df0
+   echo "The 'links' package is required for this functionality."
576df0
+   exit 8
576df0
+fi
576df0
+}
576df0
+
576df0
+function testconfig() {
576df0
+# httpd is denied terminal access in SELinux, so run in the
576df0
+# current context to get stdout from $HTTPD -t.
576df0
+if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled; then
576df0
+  runcon -- `id -Z` /usr/sbin/httpd $OPTIONS -t
576df0
+else
576df0
+  /usr/sbin/httpd $OPTIONS -t
576df0
+fi
576df0
+ERROR=$?
576df0
+}
576df0
+
576df0
+if [ "x$2" != "x" ] ; then
576df0
+    echo Passing arguments to httpd using apachectl is no longer supported.
576df0
+    echo You can only start/stop/restart httpd using this script.
576df0
+    echo If you want to pass extra arguments to httpd, edit the
576df0
+    echo /etc/sysconfig/httpd config file.
576df0
+fi
576df0
+
576df0
 case $ACMD in
576df0
-start|stop|restart|graceful|graceful-stop)
576df0
-    $HTTPD -k $ARGV
576df0
+start|stop|restart|status)
576df0
+    /usr/bin/systemctl $ACMD httpd.service
576df0
+    ERROR=$?
576df0
+    ;;
576df0
+graceful)
576df0
+    if /usr/bin/systemctl -q is-active httpd.service; then
576df0
+        /usr/bin/systemctl reload httpd.service
576df0
+    else
576df0
+        /usr/bin/systemctl start httpd.service
576df0
+    fi
576df0
+    ERROR=$?
576df0
+    ;;
576df0
+graceful-stop)
576df0
+    /usr/bin/systemctl stop httpd.service
576df0
     ERROR=$?
576df0
     ;;
576df0
 startssl|sslstart|start-SSL)
576df0
@@ -88,17 +126,14 @@ startssl|sslstart|start-SSL)
576df0
     ERROR=2
576df0
     ;;
576df0
 configtest)
576df0
-    $HTTPD -t
576df0
-    ERROR=$?
576df0
-    ;;
576df0
-status)
576df0
-    $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
576df0
+    testconfig
576df0
     ;;
576df0
 fullstatus)
576df0
+    checklynx
576df0
     $LYNX $STATUSURL
576df0
     ;;
576df0
 *)
576df0
-    $HTTPD "$@"
576df0
+    /usr/sbin/httpd $OPTIONS "$@"
576df0
     ERROR=$?
576df0
 esac
576df0