Extending --force to also cover lockfiles to avoid recursive loop within trap.

This commit is contained in:
Daniel Baumann 2007-11-11 22:03:02 +01:00
parent be5c114a90
commit d7fb22ca8b
1 changed files with 11 additions and 8 deletions

View File

@ -23,6 +23,8 @@ Check_lockfile ()
Create_lockfile ()
{
if [ "${LH_FORCE}" != "enabled" ]
then
FILE="${1}"
DIRECTORY="$(dirname ${1})"
@ -30,8 +32,9 @@ Create_lockfile ()
mkdir -p "${DIRECTORY}"
# Creating lock trap
trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove; done; exit ${ret}' EXIT
trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove --force; done; exit ${ret}' EXIT
# Creating lock file
touch "${FILE}"
fi
}