Skip to content

Commit

Permalink
init: ignore findmnt error in routine remounting, Fix #1289 (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
chitao1234 authored Mar 25, 2024
1 parent 804b5ef commit b79a705
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,9 @@ if [ "${init}" -eq 0 ]; then
for file_watch in ${HOST_WATCH}; do
# do stuff, only if the file is a mountpoint, and if the mountpoint is NOT containing the
# container id, because if it does, it is because it's part of the podman/docker setup
mount_source="$(findmnt -no SOURCE "${file_watch}")"
# The mount point might not exist, either because it's umounted or it doesn't exist on
# host in some cases like /etc/localtime, so ignore findmnt errors
mount_source="$(findmnt -no SOURCE "${file_watch}")" || :
if [ -n "${mount_source}" ] && ! echo "${mount_source}" | grep -q "${id}"; then
file_watch_src="/run/host${file_watch}"
# check if the target file exists
Expand Down

0 comments on commit b79a705

Please sign in to comment.