blob: d7350674e7dc4eab3d6e33c67aea90ee4d1abe25 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001#!/bin/bash
2
3{{/*
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17set -ex
18
19COMMAND="${@:-start}"
20
21function start () {
22
23 for KEYSTONE_WSGI_SCRIPT in keystone-wsgi-public; do
24 cp -a $(type -p ${KEYSTONE_WSGI_SCRIPT}) /var/www/cgi-bin/keystone/
25 done
26
27 {{- if .Values.conf.software.apache2.a2enmod }}
28 {{- range .Values.conf.software.apache2.a2enmod }}
29 a2enmod {{ . }}
30 {{- end }}
31 {{- end }}
32
33 {{- if .Values.conf.software.apache2.a2dismod }}
34 {{- range .Values.conf.software.apache2.a2dismod }}
35 a2dismod {{ . }}
36 {{- end }}
37 {{- end }}
38
39 if [ -f /etc/apache2/envvars ]; then
40 # Loading Apache2 ENV variables
41 source /etc/apache2/envvars
42 fi
43
44 if [ -f /var/run/apache2/apache2.pid ]; then
45 # Remove the stale pid for debian/ubuntu images
46 rm -f /var/run/apache2/apache2.pid
47 fi
48
49 # Start Apache2
50 exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
51}
52
53function stop () {
54 if [ -f /etc/apache2/envvars ]; then
55 # Loading Apache2 ENV variables
56 source /etc/apache2/envvars
57 fi
58 {{ .Values.conf.software.apache2.binary }} -k graceful-stop
59}
60
61$COMMAND