Bug#520252: cowbuilder: removes build directory even if pbuilder failed to umount bind mounts

Stefan Fritsch sf at sfritsch.de
Mon Mar 23 16:19:45 UTC 2009


On Wednesday 18 March 2009, Junichi Uekawa wrote:
> I'd like to fix this with pbuilder fix, and keep the rm -rf.  If
> you know of any reliable way to check if a bind-mounted directory
> is still mounted, I'd like to hear about it.

cowbuilder needs to be fixed, too.

cut -d' ' -f 2 /proc/mounts|
grep "$(cd /var/cache/pbuilder/build/cow.12345 ; pwd -P)"

should do it, at least if the user hasn't done stupid things like 
making this a symlink to a directory with a name containing spaces.

Note that

find /var/cache/pbuilder/build/cow.12345 -xdev -depth -delete

is also somewhat better than rm -rf, as it will protect bind mounts 
that come from other file systems than the one 
containing /var/cache/pbuilder/ . It doesn't help if the user has 
only one big filesystem, though.






More information about the Pbuilder-maint mailing list