out.append(stdout.read())
stdout.close()
- stdin = open("/vsys/vif_up.in","w")
-
# Serialize access to vsys
- lock = HostLock(stdin)
+ lockfile = open("/tmp/nepi-tun-connect.lock", "a")
+ lock = HostLock(lockfile)
+
+ stdin = open("/vsys/vif_up.in","w")
t = threading.Thread(target=outreader)
t.start()
out = ''.join(out)
if out.strip():
print >>sys.stderr, out
+
+ del lock, lockfile
def pl_vif_stop(tun_path, tun_name):
out = []
out.append(stdout.read())
stdout.close()
- stdin = open("/vsys/vif_down.in","w")
-
# Serialize access to vsys
- lock = HostLock(stdin)
+ lockfile = open("/tmp/nepi-tun-connect.lock", "a")
+ lock = HostLock(lockfile)
+
+ stdin = open("/vsys/vif_down.in","w")
t = threading.Thread(target=outreader)
t.start()
out = ''.join(out)
if out.strip():
print >>sys.stderr, out
+
+ del lock, lockfile
def tun_fwd(tun, remote):