From 2f37aa7492bb2e78b0b60643c0a0067f6cc565d9 Mon Sep 17 00:00:00 2001 From: Rick Date: Sat, 12 Nov 2016 23:39:16 +0000 Subject: [PATCH 1/3] Always restarting Apache after a frontend update --- BuildFiles/Packaging/templates/postinst-frontend.template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BuildFiles/Packaging/templates/postinst-frontend.template b/BuildFiles/Packaging/templates/postinst-frontend.template index 73ff695d..d6122e18 100644 --- a/BuildFiles/Packaging/templates/postinst-frontend.template +++ b/BuildFiles/Packaging/templates/postinst-frontend.template @@ -80,9 +80,11 @@ chown www-data:www-data /etc/swarmops/symmetricKey.config if [ -e /tmp/swarmops-restart-apache.flag ]; then /etc/init.d/apache2 start rm /tmp/swarmops-restart-apache.flag +else + # Actually, _always_ restart Apache - something isn't right otherwise + /etc/init.d/apache2 restart fi # Always end a frontend update with an Apache reload to clear caches - -/etc/init.d/apache2 reload +# /etc/init.d/apache2 reload From 47dce39342067fc587fada811ac3137358ebe06e Mon Sep 17 00:00:00 2001 From: Rick Date: Sun, 13 Nov 2016 12:08:27 +0000 Subject: [PATCH 2/3] Adding debug visibility echoes to pre-, post- rm, -inst scripts --- BuildFiles/Packaging/templates/postinst-backend.template | 5 ++++- BuildFiles/Packaging/templates/postinst-frontend.template | 4 ++++ BuildFiles/Packaging/templates/preinst-frontend.template | 3 +++ BuildFiles/Packaging/templates/prerm-backend.template | 4 +++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/BuildFiles/Packaging/templates/postinst-backend.template b/BuildFiles/Packaging/templates/postinst-backend.template index 9018c527..0f82152f 100644 --- a/BuildFiles/Packaging/templates/postinst-backend.template +++ b/BuildFiles/Packaging/templates/postinst-backend.template @@ -1,6 +1,7 @@ #!/bin/bash -#echo "Swarmops post-installation script running" +#echo "DEBUG: Executing post-installation script, swarmops-backend" + #make sure some directories exist mkdir -p /var/lib/swarmops/upload #todo: check for database upgrade @@ -18,3 +19,5 @@ else systemctl start swarmops-backend fi +echo "DEBUG: Exiting post-install script, swarmops-backend" + diff --git a/BuildFiles/Packaging/templates/postinst-frontend.template b/BuildFiles/Packaging/templates/postinst-frontend.template index d6122e18..d25b55cd 100644 --- a/BuildFiles/Packaging/templates/postinst-frontend.template +++ b/BuildFiles/Packaging/templates/postinst-frontend.template @@ -1,5 +1,7 @@ #!/bin/bash +echo "DEBUG: Executing post-install script, swarmops-frontend" + # make sure the upload folder exists and is writeable by www-data # do not make any changes to an already existing folder @@ -88,3 +90,5 @@ fi # Always end a frontend update with an Apache reload to clear caches # /etc/init.d/apache2 reload + +echo "DEBUG: Exiting post-install script, swarmops-frontend" diff --git a/BuildFiles/Packaging/templates/preinst-frontend.template b/BuildFiles/Packaging/templates/preinst-frontend.template index f58eb7a5..fb4e2da8 100644 --- a/BuildFiles/Packaging/templates/preinst-frontend.template +++ b/BuildFiles/Packaging/templates/preinst-frontend.template @@ -4,6 +4,8 @@ # (It's very rude to shut down services without asking first like this, but even more rude of the lib-mod-mono # installer to just bloody hang.) +echo "DEBUG: Executing pre-install script, swarmops-frontend" + if [ ! -e /etc/swarmops/database.config ]; then if [ -e /etc/init.d/apache2 ]; then if [ /etc/init.d/apache2 status > /dev/null ]; then @@ -14,4 +16,5 @@ if [ ! -e /etc/swarmops/database.config ]; then fi fi +echo "DEBUG: Exiting pre-install script, swarmops-frontend" diff --git a/BuildFiles/Packaging/templates/prerm-backend.template b/BuildFiles/Packaging/templates/prerm-backend.template index 86fa849e..b8ef1f3e 100644 --- a/BuildFiles/Packaging/templates/prerm-backend.template +++ b/BuildFiles/Packaging/templates/prerm-backend.template @@ -1,5 +1,7 @@ #! /bin/bash +echo "DEBUG: Executing pre-remove script, swarmops-backend" + # Different paths for systemd and upstart if [ -z $(pidof systemd) ]; then @@ -10,4 +12,4 @@ else systemctl disable swarmops-backend fi - +echo "DEBUG: Exiting pre-remove script, swarmops-backend" From 3fc5d626be0d554340607e43f1e0c473a05d762d Mon Sep 17 00:00:00 2001 From: Rick Date: Sun, 13 Nov 2016 12:39:00 +0000 Subject: [PATCH 3/3] Bugfix - package scripts were never added --- BuildFiles/Packaging/scripts/repackage-build-package | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BuildFiles/Packaging/scripts/repackage-build-package b/BuildFiles/Packaging/scripts/repackage-build-package index bb46e910..f4f487ab 100755 --- a/BuildFiles/Packaging/scripts/repackage-build-package +++ b/BuildFiles/Packaging/scripts/repackage-build-package @@ -96,8 +96,6 @@ if [ "$COPYFILES" == "yes" ]; then rm -rf $DEPLOYDIR/$TARGETDIR/staging fi - # LEAVE FOR THE NIGHT: Verify that the etcinitd files are copied on Backend build - if [ -d $SOURCEDIR/etcinitd ]; then echo "Adding /etc/init.d files..." mkdir -p etc/init.d @@ -130,7 +128,7 @@ fi cp ../../templates/control-$PACKAGENAME.template DEBIAN/control cp ../../templates/conffiles-$PACKAGE.template DEBIAN/conffiles -if [ -e "../templates/prerm-$PACKAGE.template" ]; then +if [ -e "../../templates/prerm-$PACKAGE.template" ]; then echo "Adding $PACKAGE prerm script..." cp ../../templates/prerm-$PACKAGE.template DEBIAN/prerm chmod +x DEBIAN/prerm @@ -141,7 +139,7 @@ else fi fi -if [ -e "../templates/postinst-$PACKAGE.template" ]; then +if [ -e "../../templates/postinst-$PACKAGE.template" ]; then echo "Adding $PACKAGE postinst script..." cp ../../templates/postinst-$PACKAGE.template DEBIAN/postinst chmod +x DEBIAN/postinst @@ -152,7 +150,7 @@ else fi fi -if [ -e "../templates/preinst-$PACKAGE.template" ]; then +if [ -e "../../templates/preinst-$PACKAGE.template" ]; then echo "Adding $PACKAGE preinst script..." cp ../../templates/preinst-$PACKAGE.template DEBIAN/preinst chmod +x DEBIAN/preinst