Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 81163 Details for
Bug 124724
net-www/apache2: new init script option/function "check"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for /etc/init.d/apache2
apache2-check.diff (text/plain), 1.58 KB, created by
Wolfram Schlich (RETIRED)
on 2006-03-02 17:26:09 UTC
(
hide
)
Description:
Patch for /etc/init.d/apache2
Filename:
MIME Type:
Creator:
Wolfram Schlich (RETIRED)
Created:
2006-03-02 17:26:09 UTC
Size:
1.58 KB
patch
obsolete
>--- ./apache2 2006/03/02 23:57:11 1.1 >+++ ./apache2 2006/03/03 01:11:27 >@@ -2,7 +2,7 @@ > # Copyright 1999-2005 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 > >-opts="${opts} reload configtest" >+opts="${opts} reload configtest check" > > # this next comment is important, don't remove it - it has to be somewhere in > # the init script to kill off a warning that doesn't apply to us >@@ -92,3 +92,51 @@ > eend $? > fi > } >+ >+check() { >+ # get listening sockets >+ local listen=$(lsof -c apache2 -a -Pni tcp -Fn 2>/dev/null \ >+ | grep '^n' | grep -v -- '->' | cut -c 2- \ >+ | sort -n | uniq) >+ if [ -z "${listen}" ]; then >+ ewarn "Apache2 not listening on any address :-(" >+ else >+ einfo "Apache2 listening on:" >+ eindent >+ # loop through ip+port list >+ for ip_port in ${listen}; do >+ einfon "${ip_port}, " >+ local ip=${ip_port%:*} >+ local port=${ip_port#*:} >+ case ${port} in >+ # known HTTP ports >+ 80|81|8080) >+ echo -n 'trying HTTP: ' >+ local res=$(echo -en "HEAD ${CHECK_URI:-/} HTTP/1.0\n\n" \ >+ | nc -w 3 ${ip} ${port} 2>/dev/null \ >+ | head -n 1) >+ ;; >+ # known HTTPS ports >+ 443) >+ echo -n 'trying HTTPS: ' >+ local res=$(echo -en "HEAD ${CHECK_URI:-/} HTTP/1.0\n\n" \ >+ | openssl s_client -quiet -connect ${ip_port} 2>/dev/null \ >+ | head -n 1) >+ ;; >+ # unknown ports >+ *) >+ echo -n "no idea how to handle port ${port}" >+ ;; >+ esac >+ # did we get a result? >+ if [ -n "${res}" ]; then >+ echo "${res}" >+ eend 0 >+ else >+ echo ":-(" >+ eend 1 >+ fi >+ done >+ eoutdent >+ fi >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 124724
: 81163 |
81165
|
81166