blob: 768673ec3dc47550c630900d2494d8cc37bc5ab4 [file] [log] [blame]
Jackie Huange0634c62022-05-05 19:49:22 +08001From a0e8c7e3764b168eaaa82d17d965f62d34766573 Mon Sep 17 00:00:00 2001
2From: Chris Friesen <chris.friesen@windriver.com>
3Date: Wed, 28 Nov 2018 01:33:39 -0500
4Subject: [PATCH 02] Remove stale Apache2 service pids when a POD starts.
5
6Stale Apache2 pids will prevent Apache2 from starting and will leave
7the POD in a crashed state.
8
9Note: the pid file is somewhat confusingly called
10/var/run/httpd/httpd.pid and /var/run/apache2 is just a symlink to
11/var/run/httpd.
12
13This is loosely based off the in-review upstream commit at
14https://review.openstack.org/#/c/619747
15
16Signed-off-by: Robert Church <robert.church@windriver.com>
17---
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(-)
22
23diff --git a/ceilometer/templates/bin/_ceilometer-api.sh.tpl b/ceilometer/templates/bin/_ceilometer-api.sh.tpl
24index 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 () {
28 fi
29 fi
30
31+ # Get rid of stale pid file if present.
32+ rm -f /var/run/apache2/*.pid
33+
34 # Start Apache2
35 exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
36 }
37diff --git a/keystone/templates/bin/_keystone-api.sh.tpl b/keystone/templates/bin/_keystone-api.sh.tpl
38index 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
43 fi
44
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
48- fi
49+ # Get rid of stale pid, shared memory segment and wsgi sock files if present.
50+ rm -f /var/run/apache2/*
51
52 # Start Apache2
53 exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
54diff --git a/nova/templates/bin/_nova-placement-api.sh.tpl b/nova/templates/bin/_nova-placement-api.sh.tpl
55index 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 () {
59 fi
60 fi
61
62+ # Get rid of stale pid file if present.
63+ rm -f /var/run/apache2/*.pid
64+
65 # Start Apache2
66 {{- if .Values.conf.software.apache2.a2enmod }}
67 {{- range .Values.conf.software.apache2.a2enmod }}
68--
692.7.4
70