[mapguide-commits] r8427 - in trunk/Tools/Vagrant: centos/x64 centos/x86 scripts ubuntu/x64 ubuntu/x86

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Oct 19 21:51:14 PDT 2014


Author: jng
Date: 2014-10-19 21:51:14 -0700 (Sun, 19 Oct 2014)
New Revision: 8427

Modified:
   trunk/Tools/Vagrant/centos/x64/Vagrantfile
   trunk/Tools/Vagrant/centos/x86/Vagrantfile
   trunk/Tools/Vagrant/scripts/mginstallcentos.sh
   trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
   trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile
   trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile
Log:
Vagrant build updates:
 - mginstallcentos.sh:
   - Muffle pushd/popd output
   - Perform service registration
 - mginstallubuntu.sh: Perform service registration
 - Update vagrantfiles to also copy uninstall script to final output directory

Modified: trunk/Tools/Vagrant/centos/x64/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/centos/x64/Vagrantfile	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/centos/x64/Vagrantfile	2014-10-20 04:51:14 UTC (rev 8427)
@@ -325,6 +325,7 @@
 sudo mv ~/UnitTestResults_*.xml /vagrant/build
 echo [provision]: Copy install/uninstall scripts to output dir
 sudo cp /vagrant/mginstallcentos.sh /vagrant/build/mginstallcentos.sh
+sudo cp /vagrant/mguninstallcentos.sh /vagrant/build/mguninstallcentos.sh
 sudo sed -i 's/FDOVER_REV=0/FDOVER_REV='"$FDO_REV"'/g' /vagrant/build/mginstallcentos.sh
 sudo sed -i 's/MGVER_REV=0/MGVER_REV='"$MG_REV"'/g' /vagrant/build/mginstallcentos.sh
 sudo sed -i 's/FDO_ARCH=i386/FDO_ARCH=amd64/g' /vagrant/build/mginstallcentos.sh

Modified: trunk/Tools/Vagrant/centos/x86/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/centos/x86/Vagrantfile	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/centos/x86/Vagrantfile	2014-10-20 04:51:14 UTC (rev 8427)
@@ -327,6 +327,7 @@
 sudo mv ~/UnitTestResults_*.xml /vagrant/build
 echo [provision]: Copy install/uninstall scripts to output dir
 sudo cp /vagrant/mginstallcentos.sh /vagrant/build/mginstallcentos.sh
+sudo cp /vagrant/mguninstallcentos.sh /vagrant/build/mguninstallcentos.sh
 sudo sed -i 's/FDOVER_REV=0/FDOVER_REV='"$FDO_REV"'/g' /vagrant/build/mginstallcentos.sh
 sudo sed -i 's/MGVER_REV=0/MGVER_REV='"$MG_REV"'/g' /vagrant/build/mginstallcentos.sh
 if [ ! -d /mapguide_sources/updated ]; then

Modified: trunk/Tools/Vagrant/scripts/mginstallcentos.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mginstallcentos.sh	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/scripts/mginstallcentos.sh	2014-10-20 04:51:14 UTC (rev 8427)
@@ -39,53 +39,66 @@
 tar -C / -Jxf ${MG_TARBALL}
 
 # All of this is to make SELinux happy
-pushd /usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}/lib
+pushd /usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}/lib > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
 chcon -t textrel_shlib_t mgserver
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/lib
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/lib > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/lib
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/lib > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/lib
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/lib > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/lib
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/lib > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/modules
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/modules > /dev/null
 echo "[config]: Making binaries SELinux compatible"
 chcon -t textrel_shlib_t *.so
-popd
+popd > /dev/null
 
 echo "[config]: Fixing permissions for certain folders"
 chmod 777 /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/TempDir
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin
+echo "[install]: Registering services"
+# The service control scripts as-is won't register as services as they lack chkconfig information
+# We'll inject this information by prepending this information and appending the existing script bodies
+# afterwards to the destination. We are not making symlinks.
+echo "#!/bin/sh" > /etc/init.d/mapguide
+echo "# chkconfig: 345 35 65" >> /etc/init.d/mapguide
+echo "# description: MapGuide Server Daemon" >> /etc/init.d/mapguide
+sed "s/\#\!\/bin\/sh//g" /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/mapguidectl >> /etc/init.d/mapguide
+chmod +x /etc/init.d/mapguide
+chkconfig --add mapguide
+echo "#!/bin/sh" > /etc/init.d/apache-mapguide
+echo "# chkconfig: 345 35 65" >> /etc/init.d/apache-mapguide
+echo "# description: MapGuide Server Daemon" >> /etc/init.d/apache-mapguide
+sed "s/\#\!\/bin\/sh//g" /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin/apachectl >> /etc/init.d/apache-mapguide
+chmod +x /etc/init.d/apache-mapguide
+chkconfig --add apache-mapguide
+
 echo "[install]: Starting httpd"
-./apachectl start
-popd
+/etc/init.d/mapguide start
 
-pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
 echo "[install]: Starting mgserver"
-./mgserverd.sh
-popd
+/etc/init.d/apache-mapguide start
 
 echo DONE

Modified: trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	2014-10-20 04:51:14 UTC (rev 8427)
@@ -472,23 +472,20 @@
     echo "[config]: Fixing permissions for certain folders"
     chmod 777 /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/TempDir
 
-    echo "Creating lock file directory for MapGuide Server"
-    # Create lock file directory for Server
-    if [ ! -d /var/lock/mgserver ]; then
-      mkdir /var/lock/mgserver
-    fi
-    echo "Starting httpd"
-    pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin
-    ./apachectl start
-    popd
-    echo "Starting tomcat"
+    echo "[config]: Registering Services"
+    ln -s /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/mapguidectl /etc/init.d/mapguide
+    ln -s /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin/apachectl /etc/init.d/apache-mapguide
+    update-rc.d mapguide defaults 35 65
+    update-rc.d apache-mapguide defaults 30 70
+    
+    echo "[install]: Starting httpd"
+    /etc/init.d/apache-mapguide start
+    echo "[install]: Starting tomcat"
     pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/tomcat/bin
     sh ./startup.sh
     popd
-    echo "Starting mgserver"
-    pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
-    ./mgserverd.sh
-    popd
+    echo "[install]: Starting mgserver"
+    /etc/init.d/mapguide start
     echo "DONE!"
 }
 

Modified: trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile	2014-10-20 04:51:14 UTC (rev 8427)
@@ -366,6 +366,7 @@
 sudo cp bin/*.deb /vagrant/build
 sudo cp ~/UnitTestResults_*.xml /vagrant/build
 sudo cp /vagrant/mginstallubuntu.sh /vagrant/build/mginstallubuntu.sh
+sudo cp /vagrant/mguninstallubuntu.sh /vagrant/build/mguninstallubuntu.sh
 sudo sed -i 's/FDOBUILD=0/FDOBUILD='"$FDO_REV"'/g' /vagrant/build/mginstallubuntu.sh
 sudo sed -i 's/MGBUILD=0/MGBUILD='"$MG_REV"'/g' /vagrant/build/mginstallubuntu.sh
 sudo sed -i 's/FDOARCH=i386/FDOARCH=amd64/g' /vagrant/build/mginstallubuntu.sh

Modified: trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile	2014-10-20 03:21:09 UTC (rev 8426)
+++ trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile	2014-10-20 04:51:14 UTC (rev 8427)
@@ -366,6 +366,7 @@
 sudo cp bin/*.deb /vagrant/build
 sudo cp ~/UnitTestResults_*.xml /vagrant/build
 sudo cp /vagrant/mginstallubuntu.sh /vagrant/build/mginstallubuntu.sh
+sudo cp /vagrant/mguninstallubuntu.sh /vagrant/build/mguninstallubuntu.sh
 sudo sed -i 's/FDOBUILD=0/FDOBUILD='"$FDO_REV"'/g' /vagrant/build/mginstallubuntu.sh
 sudo sed -i 's/MGBUILD=0/MGBUILD='"$MG_REV"'/g' /vagrant/build/mginstallubuntu.sh
 # Do not update the working copy tarballs. Ubuntu 14.04 uses svn 1.8 which will break



More information about the mapguide-commits mailing list