Remove stale Apache2 service pids when a POD starts.

Stale Apache2 pids will prevent Apache2 from starting and will leave
the POD in a crashed state.

Note: the pid file is somewhat confusingly called
/var/run/httpd/httpd.pid and /var/run/apache2 is just a symlink to
/var/run/httpd.

This is loosely based off the in-review upstream commit at
https://review.openstack.org/#/c/619747

Change-Id: Ifec8b58e4789edb1f858ef1a9d720045d8768701
Story: 2003909
Task: 27632
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
This commit is contained in:
Chris Friesen 2018-11-28 01:49:05 -05:00
parent 3997f1e574
commit a7fed049fc
3 changed files with 98 additions and 1 deletions

View File

@ -5,4 +5,4 @@ TAR="$TAR_NAME-$SHA.tar.gz"
COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* "
TIS_PATCH_VER=4
TIS_PATCH_VER=5

View File

@ -19,6 +19,7 @@ BuildArch: noarch
Patch01: 0001-ceilometer-chart-updates.patch
Patch02: 0002-Add-Aodh-Chart.patch
Patch03: 0003-Add-Panko-Chart.patch
Patch04: Remove-stale-Apache2-service-pids-when-a-POD-starts.patch
BuildRequires: helm
BuildRequires: openstack-helm-infra
@ -32,6 +33,7 @@ Openstack Helm charts
%patch01 -p1
%patch02 -p1
%patch03 -p1
%patch04 -p1
%build
# initialize helm and stage the toolkit

View File

@ -0,0 +1,95 @@
From 44b9b086f22a561cec91519d03750c3e501d5739 Mon Sep 17 00:00:00 2001
From: Chris Friesen <chris.friesen@windriver.com>
Date: Wed, 28 Nov 2018 01:33:39 -0500
Subject: [PATCH] Remove stale Apache2 service pids when a POD starts.
Stale Apache2 pids will prevent Apache2 from starting and will leave
the POD in a crashed state.
Note: the pid file is somewhat confusingly called
/var/run/httpd/httpd.pid and /var/run/apache2 is just a symlink to
/var/run/httpd.
This is loosely based off the in-review upstream commit at
https://review.openstack.org/#/c/619747
---
aodh/templates/bin/_aodh-api.sh.tpl | 3 +++
ceilometer/templates/bin/_ceilometer-api.sh.tpl | 3 +++
keystone/templates/bin/_keystone-api.sh.tpl | 3 +++
nova/templates/bin/_nova-placement-api.sh.tpl | 3 +++
panko/templates/bin/_panko-api.sh.tpl | 3 +++
5 files changed, 15 insertions(+)
diff --git a/aodh/templates/bin/_aodh-api.sh.tpl b/aodh/templates/bin/_aodh-api.sh.tpl
index 708b327..dfc7abc 100644
--- a/aodh/templates/bin/_aodh-api.sh.tpl
+++ b/aodh/templates/bin/_aodh-api.sh.tpl
@@ -28,6 +28,9 @@ function start () {
source /etc/apache2/envvars
fi
+ # Get rid of stale pid file if present.
+ rm -f /var/run/apache2/*.pid
+
# Start Apache2
exec apache2 -DFOREGROUND
}
diff --git a/ceilometer/templates/bin/_ceilometer-api.sh.tpl b/ceilometer/templates/bin/_ceilometer-api.sh.tpl
index cdb02f7..0950f03 100644
--- a/ceilometer/templates/bin/_ceilometer-api.sh.tpl
+++ b/ceilometer/templates/bin/_ceilometer-api.sh.tpl
@@ -25,6 +25,9 @@ function start () {
source /etc/apache2/envvars
fi
+ # Get rid of stale pid file if present.
+ rm -f /var/run/apache2/*.pid
+
# Start Apache2
exec apache2 -DFOREGROUND
}
diff --git a/keystone/templates/bin/_keystone-api.sh.tpl b/keystone/templates/bin/_keystone-api.sh.tpl
index 217d942..a5950a4 100644
--- a/keystone/templates/bin/_keystone-api.sh.tpl
+++ b/keystone/templates/bin/_keystone-api.sh.tpl
@@ -31,6 +31,9 @@ function start () {
source /etc/apache2/envvars
fi
+ # Get rid of stale pid file if present.
+ rm -f /var/run/apache2/*.pid
+
# Start Apache2
exec apache2 -DFOREGROUND
}
diff --git a/nova/templates/bin/_nova-placement-api.sh.tpl b/nova/templates/bin/_nova-placement-api.sh.tpl
index f9c8d7c..a7d753e 100644
--- a/nova/templates/bin/_nova-placement-api.sh.tpl
+++ b/nova/templates/bin/_nova-placement-api.sh.tpl
@@ -28,6 +28,9 @@ function start () {
source /etc/apache2/envvars
fi
+ # Get rid of stale pid file if present.
+ rm -f /var/run/apache2/*.pid
+
# Start Apache2
exec apache2 -DFOREGROUND
}
diff --git a/panko/templates/bin/_panko-api.sh.tpl b/panko/templates/bin/_panko-api.sh.tpl
index bd08a43..c4ffc3f 100755
--- a/panko/templates/bin/_panko-api.sh.tpl
+++ b/panko/templates/bin/_panko-api.sh.tpl
@@ -28,6 +28,9 @@ function start () {
source /etc/apache2/envvars
fi
+ # Get rid of stale pid file if present.
+ rm -f /var/run/apache2/*.pid
+
# Start Apache2
exec apache2 -DFOREGROUND
}
--
1.8.3.1