Hello,
I had a problem where propellor refused to create a chroot because the target
directory was not empty. Actually, the directory contained lost+found
.
I made a patch to ignore this directory, do you see any bad side effect?
You can pull the ignore-lost-n-found
branch at http://git.ni.fr.eu.org/nicolas/propellor.git
.
Nicolas.
I feel that modifying
dirCruft
to include "lost+found" is a layering violation, because it could change the behavior of a lot of things besides checking if a directory is empty "enough". Consider code that recurses through a directory and sets permissions or owner.This calls for a new function, or a modification to a more specific function, to handle the "lost+found" case.
Propellor.Property.Chroot.Util.unpopulated
seems like a good place to handle it.There are also some backup/restore properties, for Borg and Restic etc, that only do a restore if a directory is empty or missing, and it seems to make sense for them to also special-case handling of "lost+found". So it would make sense to move
unpopulated
to a module that's not chroot-specific and make those things also use it.Here is a new version.
I have put it in
Utility.Directory
as it is quite generic.