Mailman: stop services during an update

This commit is contained in:
Aurélien Bompard 2017-01-26 10:41:49 +00:00
parent 1e8171d8ca
commit 308099e373

View file

@ -14,6 +14,11 @@ INDEXDIR=$BASEDIR/fulltext_index
sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty. sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty.
$BASEDIR/bin/pg-give-rights.py > /dev/null $BASEDIR/bin/pg-give-rights.py > /dev/null
echo "Stop services"
systemctl stop mailman3
sleep 5
systemctl stop httpd
echo "static files" echo "static files"
django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings
django-admin compress --pythonpath $CONFDIR --settings settings django-admin compress --pythonpath $CONFDIR --settings settings
@ -26,14 +31,15 @@ chown apache:apache -R $INDEXDIR
# SELinux contexts # SELinux contexts
echo "SELinux contexts" echo "SELinux contexts"
restorecon -r "$BASEDIR" restorecon -r $BASEDIR/{bin,config,fulltext_index,static,templates}
# Run unit tests # Run unit tests
echo "unit tests" echo "unit tests"
django-admin test --pythonpath $CONFDIR --settings settings_test hyperkitty postorius django-admin test --pythonpath $CONFDIR --settings settings_test hyperkitty postorius
# Reload Apache to flush the python cache # Restart services
systemctl reload httpd systemctl start httpd
systemctl start mailman3
# Clean the cache # Clean the cache
systemctl restart memcached systemctl restart memcached