Merge pull request #11733 from overleaf/msm-close-site-sp-shutdwn

[CE/SP] close site on shutdown before flushing

GitOrigin-RevId: e36c80f2f4c6f10eda3a536319a2fcc5dfda4fa4
This commit is contained in:
Tim Down
2023-02-08 15:19:18 +00:00
committed by Copybot
parent 2ff7d00170
commit cd4eb82f28
5 changed files with 109 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
# pre-shutdown scripts close the site by overriding the content of SITE_MAINTENANCE_FILE,
# this script restores the original value on container restart
SITE_MAINTENANCE_FILE_BAK="$SITE_MAINTENANCE_FILE.bak.shutdown"
if [ -f "${SITE_MAINTENANCE_FILE_BAK}" ]; then
mv -f "${SITE_MAINTENANCE_FILE_BAK}" "${SITE_MAINTENANCE_FILE}"
rm -f "${SITE_MAINTENANCE_FILE_BAK}"
fi