From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6140B1382C5 for ; Thu, 15 Mar 2018 10:11:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80BB3E07EF; Thu, 15 Mar 2018 10:11:21 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5EACBE07EF for ; Thu, 15 Mar 2018 10:11:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 156D1335C75 for ; Thu, 15 Mar 2018 10:11:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 20A2D216 for ; Thu, 15 Mar 2018 10:11:18 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1521108578.9e3d349cc1ee14e91d377b6a38c786ac4b153fe5.polynomial-c@gentoo> Subject: [gentoo-commits] proj/apache:master commit in: 2.4/scripts/ X-VCS-Repository: proj/apache X-VCS-Files: 2.4/scripts/apache2ctl X-VCS-Directories: 2.4/scripts/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 9e3d349cc1ee14e91d377b6a38c786ac4b153fe5 X-VCS-Branch: master Date: Thu, 15 Mar 2018 10:11:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 35604a8d-6931-4241-8983-ebab261dc13b X-Archives-Hash: 441f1621d7c43a3f57214fdc6719a8a0 commit: 9e3d349cc1ee14e91d377b6a38c786ac4b153fe5 Author: Lars Wendler gentoo org> AuthorDate: Thu Mar 15 10:07:38 2018 +0000 Commit: Lars Wendler gentoo org> CommitDate: Thu Mar 15 10:09:38 2018 +0000 URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=9e3d349c 2.4/scripts/apache2ctl: Pass commands to the apache daemon. Gentoo-Bug: https://bugs.gentoo.org/634414 Thanks-to: Joona Hoikkala kuori.org> Thanks-to: Andrey Falko gmail.com> 2.4/scripts/apache2ctl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/2.4/scripts/apache2ctl b/2.4/scripts/apache2ctl old mode 100755 new mode 100644 index eff10b5..2c7c699 --- a/2.4/scripts/apache2ctl +++ b/2.4/scripts/apache2ctl @@ -1,2 +1,25 @@ #!/bin/sh -exec /etc/init.d/apache2 "$@" + +APACHE2="/usr/sbin/apache2" +APACHE_OPTS="" +APACHE_RC_CONF="/etc/conf.d/apache2" +# List of init script verbs that should be passed forward +RC_VERBS="start stop restart checkconfd configtest modules virtualhosts configdump fullstatus graceful gracefulstop reload" + +load_rc_config() { + [ -f "${APACHE_RC_CONF}" ] || return 1 + eval "export $(grep '^[[:space:]]*APACHE2_OPTS' ${APACHE_RC_CONF})" + eval $(grep '^[[:space:]]*SERVERROOT' ${APACHE_RC_CONF}) + eval $(grep '^[[:space:]]*CONFIGFILE' ${APACHE_RC_CONF}) + export SERVERROOT="${SERVERROOT:-/usr/@LIBDIR@/apache2}" + export CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}" +} + +# If first parameter is a verb defined in $RC_VERBS, pass the command to init script. +# In other cases, compile command line and run the command on apache binary. +if [ "${RC_VERBS}" =~ "${1}" ] ; then + exec /etc/init.d/apache2 "${@}" +else + load_rc_config || exit 1 + ${APACHE2} ${APACHE2_OPTS} -d ${SERVERROOT} -f ${CONFIGFILE} "${@}" +fi