]> git.proxmox.com Git - mirror_lxc.git/commitdiff
templates: don't fail on busy flock
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)
committerDaniel Lezcano <daniel.lezcano@free.fr>
Tue, 31 Jul 2012 14:07:18 +0000 (16:07 +0200)
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>
templates/lxc-altlinux.in
templates/lxc-debian.in
templates/lxc-fedora.in
templates/lxc-lenny.in
templates/lxc-opensuse.in
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in

index 3aba77b0764456a35ed33bd55a816926d1cde0dc..35407d0db11f37865e328884f7abb3602c195594 100644 (file)
@@ -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
index 34d959316a79063cd96f3e268448857511ede8e8..68404e31fc11aa380052a7dfbbca4eeacd29c121 100644 (file)
@@ -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
index 3aa2d73006b6e44d16fe1be772acd377f659df6c..a8fb8ea5a4b97ca57f3e3fb5fc873218f5e9dad7 100644 (file)
@@ -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
index 910c185207b302e9a96a023a276eb77a3d902c86..70a19f344c56f7e7f748ef9fd9bf507879eb14d9 100644 (file)
@@ -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
index 3d2e001746f4869eae0d11f0ec5d75ca688c94c8..6d81cf5d98957b7ab13ea861f1988193d15e4a1f 100644 (file)
@@ -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
index ba66623e68284ec9ed3b52c6a62c6ad0e69dfc3f..8cd3410eb173d11abd112dec1b47c78603efc956 100644 (file)
@@ -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
index 7f9833375b43e3406bf5ac15a3d843c595d9a246..fbee3f76915c9f3385c0287a3a0a9af17e0183da 100644 (file)
@@ -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