From 3a3834a231ba504c988c772a24f616ec46ae0cdf Mon Sep 17 00:00:00 2001 From: Andy Witter Date: Fri, 12 Jan 2018 16:20:33 -0500 Subject: [PATCH] force kill apache2 to install nginx --- templates/setup-head.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/setup-head.sh b/templates/setup-head.sh index dc9658b..b59d38b 100755 --- a/templates/setup-head.sh +++ b/templates/setup-head.sh @@ -202,7 +202,16 @@ sed -i 's/APACHE_RUN_USER=www-data/APACHE_RUN_USER=opensrf/g' /etc/apache2/envva ### shutdown apache2 echo;echo "Stopping apache2 to setup nginx...";sleep 3 systemctl stop apache2 - +# Make sure apache2 is dead just in case. +echo;echo killing apache2 processes just in case... +sleep 3 +ps -ef | grep apache2 | grep -v grep | awk '{print $2}' | xargs kill +if ps -ef | grep apache2 +then + echo;echo + echo "apache2 processes are still running please kill them manually" + read -p "Press [Enter] to continue after you have killed the processes" ENTER +fi ### Install nginx $APT_TOOL install -y nginx -- 2.11.0