From 308099e3734a042006e6114e178083122e84c8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 26 Jan 2017 10:41:49 +0000 Subject: [PATCH] Mailman: stop services during an update --- roles/mailman/files/post-update.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/mailman/files/post-update.sh b/roles/mailman/files/post-update.sh index 6dd58fa806..a386e6ffb5 100755 --- a/roles/mailman/files/post-update.sh +++ b/roles/mailman/files/post-update.sh @@ -14,6 +14,11 @@ INDEXDIR=$BASEDIR/fulltext_index sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty. $BASEDIR/bin/pg-give-rights.py > /dev/null +echo "Stop services" +systemctl stop mailman3 +sleep 5 +systemctl stop httpd + echo "static files" django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings django-admin compress --pythonpath $CONFDIR --settings settings @@ -26,14 +31,15 @@ chown apache:apache -R $INDEXDIR # SELinux contexts echo "SELinux contexts" -restorecon -r "$BASEDIR" +restorecon -r $BASEDIR/{bin,config,fulltext_index,static,templates} # Run unit tests echo "unit tests" django-admin test --pythonpath $CONFDIR --settings settings_test hyperkitty postorius -# Reload Apache to flush the python cache -systemctl reload httpd +# Restart services +systemctl start httpd +systemctl start mailman3 # Clean the cache systemctl restart memcached