* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 11:41 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 11:41 UTC (permalink / raw
To: gentoo-commits
commit: e606bdae457d39634d3d03f780cbc091dfacbdbd
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 9 11:39:44 2013 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Nov 9 11:39:44 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=e606bdae
apache2.initd: Init script now returns as failed when apache faisl to start.
---
2.2/init/apache2.initd | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 249d3de..8cbb030 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -77,12 +77,13 @@ start() {
# Use start stop daemon to apply system limits #347301
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
- i=0
+ local i=0 retval=1
while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
+ [ -e "${PIDFILE}" ] && retval=0
done
- eend $(test $i -lt ${TIMEOUT})
+ eend ${retval}
}
stop() {
@@ -101,13 +102,14 @@ stop() {
ebegin "Stopping ${SVCNAME}"
${APACHE2} ${APACHE2_OPTS} -k stop
- i=0
- while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
+ local i=0 retval=0
+ while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
&& [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
done
+ [ -e "${PIDFILE}" ] && retval=1
- eend $(test $i -lt ${TIMEOUT})
+ eend ${retval}
}
reload() {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:32 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:32 UTC (permalink / raw
To: gentoo-commits
commit: f93adbd97e960fe8cc233e58fe5b41bcc38083c3
Author: Benedikt Boehm <hollow <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 1 13:49:38 2009 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Jan 1 13:49:38 2009 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=f93adbd9
add init script action to list virtual hosts, #252194
---
2.2/init/apache2.initd | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 5c6f959..5eaf675 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -2,7 +2,7 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-opts="configdump configtest fullstatus graceful gracefulstop modules reload"
+opts="configdump configtest fullstatus graceful gracefulstop modules reload virtualhosts"
depend() {
need net
@@ -144,6 +144,11 @@ fullstatus() {
fi
}
+virtualhosts() {
+ checkconfd || return 1
+ ${APACHE2} ${APACHE2_OPTS} -S
+}
+
configdump() {
LYNX="${LYNX:-lynx -dump}"
INFOURL="${INFOURL:-http://localhost/server-info}"
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:32 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:32 UTC (permalink / raw
To: gentoo-commits
commit: 691098c479438a8746f77fca79e1de902785f4db
Author: Benedikt Boehm <hollow <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 08:32:05 2009 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 08:32:05 2009 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=691098c4
fix #285449
---
2.2/init/apache2.initd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index b6e001e..0f6fa0a 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -137,7 +137,7 @@ fullstatus() {
if ! service_started "${SVCNAME}"; then
eerror "${SVCNAME} not started"
- elif ! type -p ${LYNX} 2>&1 >/dev/null; then
+ elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
eerror "lynx not found! you need to emerge www-client/lynx"
else
${LYNX} ${STATUSURL}
@@ -157,7 +157,7 @@ configdump() {
if ! service_started "${SVCNAME}"; then
eerror "${SVCNAME} not started"
- elif ! type -p ${LYNX} 2>&1 >/dev/null; then
+ elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
eerror "lynx not found! you need to emerge www-client/lynx"
else
echo "${APACHE2} started with '${APACHE2_OPTS}'"
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:33 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:33 UTC (permalink / raw
To: gentoo-commits
commit: d2a2d8b7e5db410f5ca8f2b612c0542cdbe8254c
Author: Benedikt Boehm <hollow <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 1 05:49:01 2010 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Sep 1 05:49:01 2010 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=d2a2d8b7
fix #295916
---
2.2/init/apache2.initd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 0f6fa0a..ec0fa1c 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -46,7 +46,7 @@ checkconfig() {
${APACHE2} ${APACHE2_OPTS} -t 1>/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
- eerror "${SVCNAME} has detected a syntax error in your configuration files:"
+ eerror "${SVCNAME} has detected an error in your setup:"
${APACHE2} ${APACHE2_OPTS} -t
fi
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:33 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:33 UTC (permalink / raw
To: gentoo-commits
commit: 0c73aa70400171c0ca352792e8e73e1015af13f3
Author: Peter Volkov <pva <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 15 08:55:55 2011 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Sep 15 08:55:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=0c73aa70
Use start-stop-daemon to use system limits for apache. Fixes bug #347301 by Diego Elio Pettenò.
---
2.2/init/apache2.initd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index df7374e..66f1c73 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -69,7 +69,7 @@ start() {
[ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
ebegin "Starting ${SVCNAME}"
- ${APACHE2} ${APACHE2_OPTS} -k start
+ start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
i=0
while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
@@ -84,7 +84,7 @@ stop() {
checkconfd || return 1
ebegin "Stopping ${SVCNAME}"
- ${APACHE2} ${APACHE2_OPTS} -k stop
+ start-stop-daemon --stop --pidfile ${PIDFILE} -- ${APACHE2} ${APACHE2_OPTS} -k stop
i=0
while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:33 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:33 UTC (permalink / raw
To: gentoo-commits
commit: d8a7383814bbdb63d658200b473bac586b6255b6
Author: Peter Volkov <pva <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 18 06:10:33 2011 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Oct 18 06:10:33 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=d8a73838
Use extra_{,started}commands, bug #385637 by Martin von Gagern. Check config during restart, bug #384997 wrt Christian Ruppert (idl0r). Don't use pidof to check for running instances to make it more ConTainer friendly, bug #384267 by Stef Simoens. Drop ssl_scache check as the problem it workarounds was fixed upstream years ago: https://issues.apache.org/bugzilla/show_bug.cgi?id=21335 . Dropped '# zap!' in gracefulstop.
---
2.2/init/apache2.initd | 62 ++++++++++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 66f1c73..249d3de 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -1,11 +1,12 @@
#!/sbin/runscript
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-opts="configdump configtest fullstatus graceful gracefulstop modules reload virtualhosts"
+extra_commands="configtest modules virtualhosts"
+extra_started_commands="configdump fullstatus graceful gracefulstop reload"
-description_configdump="Dumps the configuration of the apache server. Requires lynx and server-info to be enabled."
-description_configtest="Run syntax tests for configuration files only."
+description_configdump="Dumps the configuration of the runing apache server. Requires server-info to be enabled and www-client/lynx."
+description_configtest="Run syntax tests for configuration files."
description_fullstatus="Gives the full status of the server. Requires lynx and server-status to be enabled."
description_graceful="A graceful restart advises the children to exit after the current request and reloads the configuration."
description_gracefulstop="A graceful stop advises the children to exit after the current request and stops the server."
@@ -27,8 +28,14 @@ configtest() {
}
checkconfd() {
+ if [ ! -f /etc/init.d/sysfs ]; then
+ eerror "This init script works only with openrc (baselayout-2)."
+ eerror "If you still need baselayout-1.x, please, use"
+ eerror "apache2.initd-baselayout-1 from /usr/share/doc/apache2-*/"
+ fi
+
PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
- TIMEOUT=${TIMEOUT:-10}
+ TIMEOUT=${TIMEOUT:-15}
SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
if [ ! -d ${SERVERROOT} ]; then
@@ -66,9 +73,8 @@ checkconfig() {
start() {
checkconfig || return 1
- [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
-
ebegin "Starting ${SVCNAME}"
+ # Use start stop daemon to apply system limits #347301
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
i=0
@@ -76,30 +82,38 @@ start() {
sleep 1 && i=$(expr $i + 1)
done
- test -e "${PIDFILE}"
- eend $?
+ eend $(test $i -lt ${TIMEOUT})
}
stop() {
- checkconfd || return 1
+ if [ "${RC_CMD}" = "restart" ]; then
+ checkconfig || return 1
+ else
+ checkconfd || return 1
+ fi
+
+ PID=$(cat "${PIDFILE}" 2>/dev/null)
+ if [ -z "${PID}" ]; then
+ einfo "${SVCNAME} not running (no pid file)"
+ return 0
+ fi
ebegin "Stopping ${SVCNAME}"
- start-stop-daemon --stop --pidfile ${PIDFILE} -- ${APACHE2} ${APACHE2_OPTS} -k stop
+ ${APACHE2} ${APACHE2_OPTS} -k stop
i=0
- while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do
+ while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
+ && [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
done
- test $i -lt ${TIMEOUT}
- eend $?
+ eend $(test $i -lt ${TIMEOUT})
}
reload() {
RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
checkconfig || return 1
- service_started "${SVCNAME}" || return
if [ "${RELOAD_TYPE}" = "restart" ]; then
ebegin "Restarting ${SVCNAME}"
@@ -116,7 +130,6 @@ reload() {
graceful() {
checkconfig || return 1
- service_started "${SVCNAME}" || return
ebegin "Gracefully restarting ${SVCNAME}"
${APACHE2} ${APACHE2_OPTS} -k graceful
eend $?
@@ -124,12 +137,6 @@ graceful() {
gracefulstop() {
checkconfig || return 1
-
- # zap!
- if service_started "${SVCNAME}"; then
- mark_service_stopped "${SVCNAME}"
- fi
-
ebegin "Gracefully stopping ${SVCNAME}"
${APACHE2} ${APACHE2_OPTS} -k graceful-stop
eend $?
@@ -137,7 +144,6 @@ gracefulstop() {
modules() {
checkconfig || return 1
-
${APACHE2} ${APACHE2_OPTS} -M 2>&1
}
@@ -145,9 +151,7 @@ fullstatus() {
LYNX="${LYNX:-lynx -dump}"
STATUSURL="${STATUSURL:-http://localhost/server-status}"
- if ! service_started "${SVCNAME}"; then
- eerror "${SVCNAME} not started"
- elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+ if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
eerror "lynx not found! you need to emerge www-client/lynx"
else
${LYNX} ${STATUSURL}
@@ -155,7 +159,7 @@ fullstatus() {
}
virtualhosts() {
- checkconfd || return 1
+ checkconfig || return 1
${APACHE2} ${APACHE2_OPTS} -S
}
@@ -165,9 +169,7 @@ configdump() {
checkconfd || return 1
- if ! service_started "${SVCNAME}"; then
- eerror "${SVCNAME} not started"
- elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+ if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
eerror "lynx not found! you need to emerge www-client/lynx"
else
echo "${APACHE2} started with '${APACHE2_OPTS}'"
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 15:36 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 15:36 UTC (permalink / raw
To: gentoo-commits
commit: a6a88dc3addc89f6b665828cb37a35270656023c
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 9 11:39:44 2013 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Nov 9 15:35:07 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=a6a88dc3
apache2.initd: Init script now returns as failed when apache fails to start.
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
---
2.2/init/apache2.initd | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 249d3de..8cbb030 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -77,12 +77,13 @@ start() {
# Use start stop daemon to apply system limits #347301
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
- i=0
+ local i=0 retval=1
while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
+ [ -e "${PIDFILE}" ] && retval=0
done
- eend $(test $i -lt ${TIMEOUT})
+ eend ${retval}
}
stop() {
@@ -101,13 +102,14 @@ stop() {
ebegin "Stopping ${SVCNAME}"
${APACHE2} ${APACHE2_OPTS} -k stop
- i=0
- while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
+ local i=0 retval=0
+ while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
&& [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
done
+ [ -e "${PIDFILE}" ] && retval=1
- eend $(test $i -lt ${TIMEOUT})
+ eend ${retval}
}
reload() {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2013-11-09 17:09 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2013-11-09 17:09 UTC (permalink / raw
To: gentoo-commits
commit: dc525fb7d64b5c537fac93a1fca9ff6bdcef2981
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 9 17:08:32 2013 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Nov 9 17:08:32 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=dc525fb7
Fixed location of pidfile.
---
2.2/init/apache2.confd | 2 +-
2.2/init/apache2.initd | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/2.2/init/apache2.confd b/2.2/init/apache2.confd
index 4635201..c520c20 100644
--- a/2.2/init/apache2.confd
+++ b/2.2/init/apache2.confd
@@ -42,7 +42,7 @@ APACHE2_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO"
# YOU HAVE BEEN WARNED.
# PID file
-#PIDFILE=/var/run/apache2.pid
+#PIDFILE=/run/apache2.pid
# timeout for startup/shutdown checks
#TIMEOUT=10
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 8cbb030..002e278 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -34,7 +34,7 @@ checkconfd() {
eerror "apache2.initd-baselayout-1 from /usr/share/doc/apache2-*/"
fi
- PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
+ PIDFILE="${PIDFILE:-/run/apache2.pid}"
TIMEOUT=${TIMEOUT:-15}
SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] proj/apache:master commit in: 2.2/init/
@ 2014-05-14 13:56 Lars Wendler
0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2014-05-14 13:56 UTC (permalink / raw
To: gentoo-commits
commit: 75da24d75d5fd2f10fc0c3dcfda5beb6c948fda1
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed May 14 13:56:32 2014 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed May 14 13:56:32 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=75da24d7
Attempt to fix stop of apache with mod_perl in apache-2.2 as well (bug #503986)
---
2.2/init/apache2.initd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index e3bc921..2f19cc4 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -106,7 +106,7 @@ stop() {
${APACHE2} ${APACHE2_OPTS} -k stop
local i=0 retval=0
- while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
+ while ( test -f "${PIDFILE}" || pgrep -P ${PID} apache2 >/dev/null ) \
&& [ $i -lt ${TIMEOUT} ]; do
sleep 1 && i=$(expr $i + 1)
done
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-05-14 13:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-14 13:56 [gentoo-commits] proj/apache:master commit in: 2.2/init/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2013-11-09 17:09 Lars Wendler
2013-11-09 15:36 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:32 Lars Wendler
2013-11-09 15:32 Lars Wendler
2013-11-09 11:41 Lars Wendler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox