diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2020-12-01 13:07:58 +0100 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2020-12-01 13:12:40 +0100 |
commit | db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba (patch) | |
tree | d9fe2dccbf9c24b42772583d8d6eb91e06248973 | |
parent | rolltarball.sh: Create xz compressed tarballs (diff) | |
download | apache-db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba.tar.gz apache-db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba.tar.bz2 apache-db9bc13b034e1dcca1765dbf0e2a7efcc1b6d3ba.zip |
2.4/init: Attempt to provide a way to no longer "need net" in depend
Code blatantly stolen from net-misc/openssh init script
Bug: https://bugs.gentoo.org/482092
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
-rwxr-xr-x | 2.4/init/apache2.initd | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd index b0be24a..941dad9 100755 --- a/2.4/init/apache2.initd +++ b/2.4/init/apache2.initd @@ -33,9 +33,24 @@ APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}" APACHE2="/usr/sbin/apache2" depend() { - need net use dns entropy logger mysql netmount postgresql after sshd + if ! echo ${rc_need} | grep -Fq "net." ; then + local x warn_addr + for x in $(virtualhosts | grep '^\(\[\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do + case "${x}" in + \*:80|\*.443) ;; + *) warn_addr="${warn_addr} ${x}" ;; + esac + done + if [ -n "${warn_addr}" ] ; then + need net + ewarn "You are binding an interface in you virtual hosts." + ewarn "You must add rc_need=\"net.FOO\" to your ${RC_PREFIX%/}/etc/conf.d/apache2" + ewarn "where FOO is the interface(s) providing the following address(es):" + ewarn "${warn_addr}" + fi + fi } configtest() { |