lock(): do not execute the pipe; this does not work on 2.6
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Wed, 14 Apr 2004 23:28:45 +0000 (23:28 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Wed, 14 Apr 2004 23:28:45 +0000 (23:28 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1460 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/scripts/functions

index cad0d63..f8636f3 100644 (file)
@@ -125,11 +125,10 @@ function lock
 {
     local tmp=$(mktemp /tmp/vserver-lock.XXXXXX)
     rm -f $tmp
-    mkfifo -m700 $tmp
+    mkfifo -m600 $tmp
 
-    sleep 10
     $_LOCKFILE "$1" $tmp $2 &
-    $tmp 2>/dev/null || return 1
+    grep -q true $tmp 2>/dev/null || return 1
     
     _VS_LOCKS="$! $_VS_LOCKS"
 }