fix: Ignore failing chcon on non-SELinux systems

This commit is contained in:
Robbert Klarenbeek 2024-02-14 19:09:07 +01:00
parent 8709ec8463
commit fb8d48d249
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ function _setup_save_states() {
mv "${SERVICEFILE}" "${DEST}"
# Apply SELinux security context to match the state directory, so access
# is not restricted to the current running container:
chcon -R --reference="${STATEDIR}" "${DEST}"
chcon -R --reference="${STATEDIR}" "${DEST}" 2> /dev/null || true
fi
# Symlink the original file in the container ($SERVICEFILE) to be
@ -74,7 +74,7 @@ function _setup_save_states() {
mv "${SERVICEDIR}" "${DEST}"
# Apply SELinux security context to match the state directory, so access
# is not restricted to the current running container:
chcon -R --reference="${STATEDIR}" "${DEST}"
chcon -R --reference="${STATEDIR}" "${DEST}" 2> /dev/null || true
fi
# Symlink the original path in the container ($SERVICEDIR) to be