fix: Properly implement fix
This commit is contained in:
parent
d71db46a39
commit
dad2abdb72
|
@ -31,6 +31,10 @@ function _setup_getmail() {
|
||||||
EOF
|
EOF
|
||||||
chmod -R 600 "${GETMAILRC}"
|
chmod -R 600 "${GETMAILRC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Both the debug command and cron job (that runs getmail) for getmail
|
||||||
|
# expect this location to exist. As does the `/var/mail-state` startup script.
|
||||||
|
mkdir -p /var/lib/getmail
|
||||||
else
|
else
|
||||||
_log 'debug' 'Getmail is disabled'
|
_log 'debug' 'Getmail is disabled'
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -70,14 +70,13 @@ function _setup_save_states() {
|
||||||
rm -rf "${SERVICEDIR}"
|
rm -rf "${SERVICEDIR}"
|
||||||
elif [[ -d ${SERVICEDIR} ]]; then
|
elif [[ -d ${SERVICEDIR} ]]; then
|
||||||
_log 'trace' "Moving contents of ${SERVICEDIR} to ${DEST}"
|
_log 'trace' "Moving contents of ${SERVICEDIR} to ${DEST}"
|
||||||
# An empty volume was mounted, or new content exists from enabling a feature ENV:
|
# An empty volume was mounted, or new content dir now exists from enabling a feature ENV:
|
||||||
# Ensure the original directory exists before mv, otherwise with nothing to move
|
|
||||||
# the symlink created afterwards is invalid.
|
|
||||||
mkdir -p "${SERVICEDIR}"
|
|
||||||
mv "${SERVICEDIR}" "${DEST}"
|
mv "${SERVICEDIR}" "${DEST}"
|
||||||
# Apply SELinux security context to match the state directory, so access
|
# Apply SELinux security context to match the state directory, so access
|
||||||
# is not restricted to the current running container:
|
# is not restricted to the current running container:
|
||||||
chcon -R --reference="${STATEDIR}" "${DEST}" 2>/dev/null || true
|
chcon -R --reference="${STATEDIR}" "${DEST}" 2>/dev/null || true
|
||||||
|
else
|
||||||
|
_log 'error' "${SERVICEDIR} should exist but is missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Symlink the original path in the container ($SERVICEDIR) to be
|
# Symlink the original path in the container ($SERVICEDIR) to be
|
||||||
|
|
Loading…
Reference in New Issue