force kill apache2 to install nginx
authorAndy Witter <awitter@georgialibraries.org>
Fri, 12 Jan 2018 21:20:33 +0000 (16:20 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Fri, 12 Jan 2018 21:20:33 +0000 (16:20 -0500)
templates/setup-head.sh

index dc9658b..b59d38b 100755 (executable)
@@ -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