Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/apache:master commit in: 2.4/init/
Date: Tue, 01 Dec 2020 12:20:01
Message-Id: 1606824760.db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba.polynomial-c@gentoo
1 commit: db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 12:07:58 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 12:12:40 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=db9bc13b
7
8 2.4/init: Attempt to provide a way to no longer "need net" in depend
9
10 Code blatantly stolen from net-misc/openssh init script
11
12 Bug: https://bugs.gentoo.org/482092
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 2.4/init/apache2.initd | 17 ++++++++++++++++-
16 1 file changed, 16 insertions(+), 1 deletion(-)
17
18 diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
19 index b0be24a..941dad9 100755
20 --- a/2.4/init/apache2.initd
21 +++ b/2.4/init/apache2.initd
22 @@ -33,9 +33,24 @@ APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
23 APACHE2="/usr/sbin/apache2"
24
25 depend() {
26 - need net
27 use dns entropy logger mysql netmount postgresql
28 after sshd
29 + if ! echo ${rc_need} | grep -Fq "net." ; then
30 + local x warn_addr
31 + for x in $(virtualhosts | grep '^\(\[\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do
32 + case "${x}" in
33 + \*:80|\*.443) ;;
34 + *) warn_addr="${warn_addr} ${x}" ;;
35 + esac
36 + done
37 + if [ -n "${warn_addr}" ] ; then
38 + need net
39 + ewarn "You are binding an interface in you virtual hosts."
40 + ewarn "You must add rc_need=\"net.FOO\" to your ${RC_PREFIX%/}/etc/conf.d/apache2"
41 + ewarn "where FOO is the interface(s) providing the following address(es):"
42 + ewarn "${warn_addr}"
43 + fi
44 + fi
45 }
46
47 configtest() {