You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on every server I have the problem that
/tmp/rear.XXXXXXXXX/outputfs/servername/ is not empty,
because of the file ".lockfile", so rmdir is never successful (see #298)
The solution of #298 was to add rm -Rf $BUILD_DIR/outputfs
in function cleanup_build_area_and_end_program()
in usr/share/rear/lib/framework-functions.sh
but this lead to problems mentioned in #465,
so it was changed to rmdir $v $BUILD_DIR/outputfs >&2
Looking at function cleanup_build_area_and_end_program() in usr/share/rear/lib/framework-functions.sh:
...
# line below put in comment due to issue #465
#rm -Rf $BUILD_DIR/outputfs
rmdir $v $BUILD_DIR/outputfs >&2
# in worst case it could not umount; so before remove the BUILD_DIR check if above outputfs is gone
mount | grep -q "$BUILD_DIR/outputfs"
if [[ $? -eq 0 ]]; then
# still mounted it seems
LogPrint "Directory $BUILD_DIR/outputfs still mounted - trying lazy umount"
sleep 2
umount -f -l $BUILD_DIR/outputfs >&2
rmdir $v $BUILD_DIR/outputfs >&2
fi
rmdir $v $BUILD_DIR >&2
fi
Log "End of program reached"
Wouldn't it be better to drop the first rmdir $v $BUILD_DIR/outputfs >&2
and to add rm -Rf $BUILD_DIR/outputfs
in case $BUILD_DIR/outputfs is not mounted?
...
# line below put in comment due to issue #465
#rm -Rf $BUILD_DIR/outputfs
# in worst case it could not umount; so before remove the BUILD_DIR check if above outputfs is gone
mount | grep -q "$BUILD_DIR/outputfs"
if [[ $? -eq 0 ]]; then
# still mounted it seems
LogPrint "Directory $BUILD_DIR/outputfs still mounted - trying lazy umount"
sleep 2
umount -f -l $BUILD_DIR/outputfs >&2
rmdir $v $BUILD_DIR/outputfs >&2
else
# not mounted so we can safely delete $BUILD_DIR/outputfs
rm -Rf $BUILD_DIR/outputfs
fi
rmdir $v $BUILD_DIR >&2
fi
Log "End of program reached"
So if $BUILD_DIR/outputfs is not mounted,
then rm -Rf $BUILD_DIR/outputfs can safely be used,
otherwise rmdir $v $BUILD_DIR/outputfs would be used.
What do you think?
Regards
goldzahn
The text was updated successfully, but these errors were encountered:
@goldzahn good thinking - why not. Will you prepare a pull request for this? Thank you for your proposal of a proper fix for the issues around the cleanup of the temporary directory
Hi,
on every server I have the problem that
/tmp/rear.XXXXXXXXX/outputfs/servername/ is not empty,
because of the file ".lockfile", so rmdir is never successful (see #298)
The solution of #298 was to add
rm -Rf $BUILD_DIR/outputfs
in function
cleanup_build_area_and_end_program()
in usr/share/rear/lib/framework-functions.sh
but this lead to problems mentioned in #465,
so it was changed to
rmdir $v $BUILD_DIR/outputfs >&2
Looking at function cleanup_build_area_and_end_program() in usr/share/rear/lib/framework-functions.sh:
Wouldn't it be better to drop the first
rmdir $v $BUILD_DIR/outputfs >&2
and to add
rm -Rf $BUILD_DIR/outputfs
in case $BUILD_DIR/outputfs is not mounted?
So if $BUILD_DIR/outputfs is not mounted,
then
rm -Rf $BUILD_DIR/outputfs
can safely be used,otherwise
rmdir $v $BUILD_DIR/outputfs
would be used.What do you think?
Regards
goldzahn
The text was updated successfully, but these errors were encountered: