mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-25 09:19:41 +00:00
templates: don't fail on busy flock
Just wait until the lock is available. That is a nicer behavior for concurrent lxc-creates. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
e7f0d73311
commit
add1d11833
@ -198,7 +198,7 @@ install_altlinux()
|
||||
{
|
||||
mkdir -p /var/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
@ -314,7 +314,7 @@ clean()
|
||||
|
||||
# lock, so we won't purge while someone is creating a repository
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? != 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
exit 1
|
||||
|
@ -153,7 +153,7 @@ install_debian()
|
||||
rootfs=$1
|
||||
mkdir -p @LOCALSTATEDIR@/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
@ -234,7 +234,7 @@ clean()
|
||||
|
||||
# lock, so we won't purge while someone is creating a repository
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? != 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
exit 1
|
||||
|
@ -190,7 +190,7 @@ install_fedora()
|
||||
{
|
||||
mkdir -p /var/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
@ -284,7 +284,7 @@ clean()
|
||||
|
||||
# lock, so we won't purge while someone is creating a repository
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? != 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
exit 1
|
||||
|
@ -142,7 +142,7 @@ install_debian()
|
||||
rootfs=$1
|
||||
mkdir -p @LOCALSTATEDIR@/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
@ -222,7 +222,7 @@ clean()
|
||||
|
||||
# lock, so we won't purge while someone is creating a repository
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? != 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
exit 1
|
||||
|
@ -217,7 +217,7 @@ install_opensuse()
|
||||
rootfs=$1
|
||||
mkdir -p /var/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
@ -303,7 +303,7 @@ clean()
|
||||
|
||||
# lock, so we won't purge while someone is creating a repository
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? != 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
exit 1
|
||||
|
@ -290,7 +290,7 @@ build_root_tgz()
|
||||
|
||||
mkdir -p /var/lock/subsys/
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
|
||||
cd $cache
|
||||
if [ $flushcache -eq 1 ]; then
|
||||
|
@ -228,7 +228,7 @@ install_ubuntu()
|
||||
mkdir -p /var/lock/subsys/
|
||||
|
||||
(
|
||||
flock -n -x 200
|
||||
flock -x 200
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cache repository is busy."
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user