-
-
Notifications
You must be signed in to change notification settings - Fork 268
Fixes #781 Fix for removing directory in case that they are not empty #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Petr Hracek <[email protected]>
Fixes #781 Fix for removing directory in case that they are not empty
|
Hello, @phracek @gdha , why this change? It reverts (partially) the change in 8a545d6 and risks reintroducing bug #465. The point is, when the directory is not empty, you should not remove it, because it can contain valuable data, like previous backups or backups from other machines. |
|
More general question, the function Similar question applies to [[ -d $BUILD_DIR/outputfs/$NETFS_PREFIX ]] && rm -rf $v $BUILD_DIR/outputfs/$NETFS_PREFIX
[[ -d $BUILD_DIR/outputfs/$RSYNC_PREFIX ]] && rm -rf $v $BUILD_DIR/outputfs/$RSYNC_PREFIXin usr/share/rear/output/default/980_umount_output_dir.sh although this part has not been touched by this change nor by 8a545d6. (I am asking because there seem to be way too many places where we rm -rf potentially valuable data.) |
|
I also found that |
|
@pcahyna |
|
@jsmeix thanks for your encouragement, but I first wanted to learn the intent of the current code (in this case, duplication of output directory removal) before attemtoting any cleanup :-) |
…-updated Fix backup removal in exit task and cleanup handling of URL mountpoints: Cleanup of temporary mount point handling, particularly for output. Unification of mount point umount and cleanup move to the mount_url() and umount_url() functions. Replaced the various "rm -rf" of the mountpoint by "rmdir" which fixes #2611 Added lazy umount in case normal umount does not succeed. If build dir is kept (cf. KEEP_BUILD_DIR), propose a safe way to remove it to the user via "rm -Rf --one-file-system" instead of just "rm -Rf" where the user risks to remove everything below that mountpoint if still mounted. Fixes also some other bugs noted in the process: Filesystem-specific umount command not called 20359a9#r51319634 Unknown schemes considered invalid, see the discussion under #932 Identical scripts under DUPLICITY and YUM replaced by symlinks. Reverted #782 that had reintroduced #465 which got re-reported as #2611 Reverted #578 because it is not clear how .lockfile can exist in the unmounted filesystem, and if it does, it is a bug. Reverted d850c40 because it became meanwhile obsoleted by a8fdc44
Signed-off-by: Petr Hracek [email protected]