os.chmod(tmpdir_new, 0755)
locks = []
- for p in (componentdir, live, tmpdir_new):
- if not os.path.exists(p): os.mkdir(p, 0755)
+ lockfiles = [ os.path.join(basemaster, component + ".lock") ]
+ for p in lockfiles:
fd = os.open(p, os.O_RDONLY)
log("Acquiring lock for %s(%d)."%(p,fd))
fcntl.flock(fd, fcntl.LOCK_EX)
locks.append(fd)
log("All locks acquired.")
+ for p in (live, ):
+ if not os.path.exists(p): os.mkdir(p, 0755)
+
+ #for p in (componentdir, live, tmpdir_new):
+ # if not os.path.exists(p): os.mkdir(p, 0755)
+ # fd = os.open(p, os.O_RDONLY)
+ # log("Acquiring lock for %s(%d)."%(p,fd))
+ # fcntl.flock(fd, fcntl.LOCK_EX)
+ # locks.append(fd)
+ #log("All locks acquired.")
+
serialfile = os.path.join(componentdir, serialname)
try:
with open(serialfile) as f: serial = int(f.read())