mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-28 13:58:22 +02:00
Fix checksum race condition in check-for-changes.sh
If a change to one of the tracked files happened soon after (<1 second?) a previously detected change, it could end up going undetected. In particular, this could cause integration tests to fail (see next commits). Fixed by computing the new checksum file _before_ checking for changes.
This commit is contained in:
parent
f225e14a21
commit
2a70f33a4b
5 changed files with 39 additions and 32 deletions
|
@ -73,3 +73,23 @@ for key, value in acme.items():
|
|||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# File storing the checksums of the monitored files.
|
||||
CHKSUM_FILE=/tmp/docker-mailserver-config-chksum
|
||||
|
||||
# Compute checksums of monitored files.
|
||||
function monitored_files_checksums() {
|
||||
(
|
||||
cd /tmp/docker-mailserver
|
||||
# (2>/dev/null to ignore warnings about files that don't exist)
|
||||
exec sha512sum 2>/dev/null -- \
|
||||
postfix-accounts.cf \
|
||||
postfix-virtual.cf \
|
||||
postfix-aliases.cf \
|
||||
dovecot-quotas.cf \
|
||||
/etc/letsencrypt/acme.json \
|
||||
"/etc/letsencrypt/live/$HOSTNAME/key.pem" \
|
||||
"/etc/letsencrypt/live/$HOSTNAME/fullchain.pem"
|
||||
)
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue