chore: split `_setup_save_states` for restart purposes
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
ae5e2c5a99
commit
11b568aad5
|
@ -122,7 +122,9 @@ function _register_functions() {
|
||||||
_register_setup_function '_setup_logwatch'
|
_register_setup_function '_setup_logwatch'
|
||||||
|
|
||||||
_register_setup_function '_setup_save_states'
|
_register_setup_function '_setup_save_states'
|
||||||
|
# TODO
|
||||||
_register_setup_function '_setup_apply_fixes_after_configuration'
|
_register_setup_function '_setup_apply_fixes_after_configuration'
|
||||||
|
_register_setup_function '_setup_adjust_state_permissions'
|
||||||
|
|
||||||
if [[ ${ENABLE_MTA_STS} -eq 1 ]]; then
|
if [[ ${ENABLE_MTA_STS} -eq 1 ]]; then
|
||||||
_register_setup_function '_setup_mta_sts'
|
_register_setup_function '_setup_mta_sts'
|
||||||
|
@ -186,7 +188,10 @@ _check
|
||||||
# Ensure DMS only adjusts config files for a new container.
|
# Ensure DMS only adjusts config files for a new container.
|
||||||
# Container restarts should skip as they retain the modified config.
|
# Container restarts should skip as they retain the modified config.
|
||||||
if [[ -f /CONTAINER_START ]]; then
|
if [[ -f /CONTAINER_START ]]; then
|
||||||
_log 'info' 'Container was restarted. Skipping setup routines.'
|
_log 'info' 'Container was restarted. Skipping most setup routines.'
|
||||||
|
# We cannot skip all setup routines because some need to run _after_
|
||||||
|
# the initial setup (and hence, they cannot be moved to the check stack).
|
||||||
|
_setup_adjust_state_permissions
|
||||||
else
|
else
|
||||||
_setup
|
_setup
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -83,7 +83,13 @@ function _setup_save_states() {
|
||||||
# sourced from assocaiated path in /var/mail-state/ ($DEST):
|
# sourced from assocaiated path in /var/mail-state/ ($DEST):
|
||||||
ln -s "${DEST}" "${SERVICEDIR}"
|
ln -s "${DEST}" "${SERVICEDIR}"
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
_log 'debug' "'${STATEDIR}' is not present; Not consolidating state"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _setup_adjust_state_permissions() {
|
||||||
|
if [[ -d ${STATEDIR} ]]; then
|
||||||
# This ensures the user and group of the files from the external mount have their
|
# This ensures the user and group of the files from the external mount have their
|
||||||
# numeric ID values in sync. New releases where the installed packages order changes
|
# numeric ID values in sync. New releases where the installed packages order changes
|
||||||
# can change the values in the Docker image, causing an ownership mismatch.
|
# can change the values in the Docker image, causing an ownership mismatch.
|
||||||
|
@ -119,7 +125,5 @@ function _setup_save_states() {
|
||||||
# Ref: https://github.com/docker-mailserver/docker-mailserver/pull/3625
|
# Ref: https://github.com/docker-mailserver/docker-mailserver/pull/3625
|
||||||
chmod 730 "${STATEDIR}/spool-postfix/maildrop"
|
chmod 730 "${STATEDIR}/spool-postfix/maildrop"
|
||||||
chmod 710 "${STATEDIR}/spool-postfix/public"
|
chmod 710 "${STATEDIR}/spool-postfix/public"
|
||||||
else
|
|
||||||
_log 'debug' "'${STATEDIR}' is not present; Not consolidating state"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue