2012-10-03 12:50:34 +00:00
|
|
|
|
2016-04-07 13:07:25 +00:00
|
|
|
Make apachectl run via systemctl.
|
|
|
|
|
|
|
|
Note: "apachectl graceful" is documented to start httpd if not running.
|
|
|
|
|
2012-10-03 12:50:34 +00:00
|
|
|
Upstream-Status: vendor specific patch
|
|
|
|
|
2018-09-28 07:51:19 +00:00
|
|
|
--- httpd-2.4.34/support/apachectl.in.apctlsystemd
|
|
|
|
+++ httpd-2.4.34/support/apachectl.in
|
|
|
|
@@ -58,11 +58,6 @@
|
|
|
|
# have one, then status and fullstatus will not work.
|
|
|
|
STATUSURL="http://localhost:@PORT@/server-status"
|
|
|
|
|
|
|
|
-# Source /etc/sysconfig/httpd for $HTTPD setting, etc.
|
|
|
|
-if [ -r /etc/sysconfig/httpd ]; then
|
|
|
|
- . /etc/sysconfig/httpd
|
|
|
|
-fi
|
|
|
|
-
|
|
|
|
#
|
|
|
|
# Set this variable to a command that increases the maximum
|
|
|
|
# number of file descriptors allowed per child process. This is
|
|
|
|
@@ -100,9 +95,28 @@
|
2012-10-01 07:17:09 +00:00
|
|
|
ERROR=$?
|
|
|
|
}
|
|
|
|
|
|
|
|
+if [ "x$2" != "x" ] ; then
|
|
|
|
+ echo Passing arguments to httpd using apachectl is no longer supported.
|
|
|
|
+ echo You can only start/stop/restart httpd using this script.
|
2018-11-07 11:38:50 +00:00
|
|
|
+ echo "To pass extra arguments to httpd, see the httpd.service(8)"
|
2018-09-28 07:51:19 +00:00
|
|
|
+ echo man page.
|
2012-10-01 07:17:09 +00:00
|
|
|
+fi
|
|
|
|
+
|
|
|
|
case $ACMD in
|
|
|
|
-start|stop|restart|graceful|graceful-stop)
|
|
|
|
- $HTTPD $OPTIONS -k $ARGV
|
|
|
|
+start|stop|restart|status)
|
|
|
|
+ /usr/bin/systemctl $ACMD httpd.service
|
|
|
|
+ ERROR=$?
|
|
|
|
+ ;;
|
|
|
|
+graceful)
|
2016-04-07 13:07:25 +00:00
|
|
|
+ if /usr/bin/systemctl -q is-active httpd.service; then
|
|
|
|
+ /usr/bin/systemctl reload httpd.service
|
|
|
|
+ else
|
|
|
|
+ /usr/bin/systemctl start httpd.service
|
|
|
|
+ fi
|
2012-10-01 07:17:09 +00:00
|
|
|
+ ERROR=$?
|
|
|
|
+ ;;
|
|
|
|
+graceful-stop)
|
|
|
|
+ /usr/bin/systemctl stop httpd.service
|
|
|
|
ERROR=$?
|
|
|
|
;;
|
|
|
|
startssl|sslstart|start-SSL)
|
2018-09-28 07:51:19 +00:00
|
|
|
@@ -114,10 +128,6 @@
|
2012-10-01 07:17:09 +00:00
|
|
|
configtest)
|
|
|
|
testconfig
|
|
|
|
;;
|
|
|
|
-status)
|
|
|
|
- checklynx
|
|
|
|
- $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
|
|
|
|
- ;;
|
|
|
|
fullstatus)
|
|
|
|
checklynx
|
|
|
|
$LYNX $STATUSURL
|