This commit is contained in:
Falkvinge
2016-11-13 14:17:49 +01:00
5 changed files with 20 additions and 8 deletions
@@ -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
@@ -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"
@@ -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
@@ -80,9 +82,13 @@ 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
echo "DEBUG: Exiting post-install script, swarmops-frontend"
@@ -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"
@@ -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"