From 1db9b5d3cab9ecfdc3505ea40ac4f504075fbea0 Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Fri, 3 Nov 2017 08:37:21 +0000 Subject: [PATCH] Remove apache tls-proxy sites when stopping Currently doing a cycle of ./stack.sh; ./unstack.sh; ./stack.sh fails because the leftover tls-proxy sites will cause apache startup to fail on the second stack.sh run. So we need to disable these sites on running stop_tls_proxy. Change-Id: I03e6879be332289d19ca6a656f5f9f139dffff6f Closes-Bug: 1718189 --- lib/tls | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/tls b/lib/tls index 0baf86caa9..0bc389bb88 100644 --- a/lib/tls +++ b/lib/tls @@ -564,6 +564,20 @@ function follow_tls_proxy { # using tls configuration are down. function stop_tls_proxy { stop_apache_server + + # NOTE(jh): Removing all tls-proxy configs is a bit of a hack, but + # necessary so that we can restart after an unstack. A better + # solution would be to ensure that each service calling + # start_tls_proxy will call stop_tls_proxy with the same + # parameters on shutdown so we can use the disable_apache_site + # function and remove individual files there. + if is_ubuntu; then + sudo rm -f /etc/apache2/sites-enabled/*-tls-proxy.conf + else + for i in $APACHE_CONF_DIR/*-tls-proxy.conf; do + sudo mv $i $i.disabled + done + fi } # Clean up the CA files