Extending --force to also cover lockfiles to avoid recursive loop within trap.
This commit is contained in:
parent
be5c114a90
commit
d7fb22ca8b
|
@ -23,15 +23,18 @@ Check_lockfile ()
|
||||||
|
|
||||||
Create_lockfile ()
|
Create_lockfile ()
|
||||||
{
|
{
|
||||||
FILE="${1}"
|
if [ "${LH_FORCE}" != "enabled" ]
|
||||||
DIRECTORY="$(dirname ${1})"
|
then
|
||||||
|
FILE="${1}"
|
||||||
|
DIRECTORY="$(dirname ${1})"
|
||||||
|
|
||||||
# Creating lock directory
|
# Creating lock directory
|
||||||
mkdir -p "${DIRECTORY}"
|
mkdir -p "${DIRECTORY}"
|
||||||
|
|
||||||
# Creating lock trap
|
# 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
|
# Creating lock file
|
||||||
touch "${FILE}"
|
touch "${FILE}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue