1 From a0e8c7e3764b168eaaa82d17d965f62d34766573 Mon Sep 17 00:00:00 2001
2 From: Chris Friesen <chris.friesen@windriver.com>
3 Date: Wed, 28 Nov 2018 01:33:39 -0500
4 Subject: [PATCH 02] Remove stale Apache2 service pids when a POD starts.
6 Stale Apache2 pids will prevent Apache2 from starting and will leave
7 the POD in a crashed state.
9 Note: the pid file is somewhat confusingly called
10 /var/run/httpd/httpd.pid and /var/run/apache2 is just a symlink to
13 This is loosely based off the in-review upstream commit at
14 https://review.openstack.org/#/c/619747
16 Signed-off-by: Robert Church <robert.church@windriver.com>
18 ceilometer/templates/bin/_ceilometer-api.sh.tpl | 3 +++
19 keystone/templates/bin/_keystone-api.sh.tpl | 6 ++----
20 nova/templates/bin/_nova-placement-api.sh.tpl | 3 +++
21 3 files changed, 8 insertions(+), 4 deletions(-)
23 diff --git a/ceilometer/templates/bin/_ceilometer-api.sh.tpl b/ceilometer/templates/bin/_ceilometer-api.sh.tpl
24 index 25b2f9e..3870b4e 100644
25 --- a/ceilometer/templates/bin/_ceilometer-api.sh.tpl
26 +++ b/ceilometer/templates/bin/_ceilometer-api.sh.tpl
27 @@ -42,6 +42,9 @@ function start () {
31 + # Get rid of stale pid file if present.
32 + rm -f /var/run/apache2/*.pid
35 exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
37 diff --git a/keystone/templates/bin/_keystone-api.sh.tpl b/keystone/templates/bin/_keystone-api.sh.tpl
38 index 384ee8b..4c72310 100644
39 --- a/keystone/templates/bin/_keystone-api.sh.tpl
40 +++ b/keystone/templates/bin/_keystone-api.sh.tpl
41 @@ -43,10 +43,8 @@ function start () {
42 source /etc/apache2/envvars
45 - if [ -f /var/run/apache2/apache2.pid ]; then
46 - # Remove the stale pid for debian/ubuntu images
47 - rm -f /var/run/apache2/apache2.pid
49 + # Get rid of stale pid, shared memory segment and wsgi sock files if present.
50 + rm -f /var/run/apache2/*
53 exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
54 diff --git a/nova/templates/bin/_nova-placement-api.sh.tpl b/nova/templates/bin/_nova-placement-api.sh.tpl
55 index bc15a37..055d079 100644
56 --- a/nova/templates/bin/_nova-placement-api.sh.tpl
57 +++ b/nova/templates/bin/_nova-placement-api.sh.tpl
58 @@ -33,6 +33,9 @@ function start () {
62 + # Get rid of stale pid file if present.
63 + rm -f /var/run/apache2/*.pid
66 {{- if .Values.conf.software.apache2.a2enmod }}
67 {{- range .Values.conf.software.apache2.a2enmod }}