Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-openstack-armada-app / openstack-helm / 0002-Remove-stale-Apache2-service-pids-when-a-POD-starts.patch
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.
5
6 Stale Apache2 pids will prevent Apache2 from starting and will leave
7 the POD in a crashed state.
8
9 Note: 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
13 This is loosely based off the in-review upstream commit at
14 https://review.openstack.org/#/c/619747
15
16 Signed-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
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 () {
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  }
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
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 }}
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 () {
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 -- 
69 2.7.4
70