fix: `/var/mail-state` should ensure service dir exists before symlinking
The Getmail service doesn't have a directory in `/var/lib/` by default, yet `mail-state` is configured to symlink it, and the service in DMS is configured to expect `/var/lib/getmail` exists. Handled in `mail-state` logic to ensure it doesn't silently fail.
This commit is contained in:
parent
5bd8df68eb
commit
d71db46a39
|
@ -70,7 +70,10 @@ function _setup_save_states() {
|
|||
rm -rf "${SERVICEDIR}"
|
||||
elif [[ -d ${SERVICEDIR} ]]; then
|
||||
_log 'trace' "Moving contents of ${SERVICEDIR} to ${DEST}"
|
||||
# Empty volume was mounted, or new content from enabling a feature ENV:
|
||||
# An empty volume was mounted, or new content 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}"
|
||||
# Apply SELinux security context to match the state directory, so access
|
||||
# is not restricted to the current running container:
|
||||
|
|
Loading…
Reference in New Issue