mirror of
https://github.com/Rudd-O/ansible-qubes.git
synced 2025-06-06 18:08:31 +02:00
Eliminate the lock.
This commit is contained in:
parent
3a60f0ee4b
commit
8675eaa547
@ -2,7 +2,6 @@
|
||||
|
||||
import base64
|
||||
import pickle
|
||||
import contextlib
|
||||
import errno
|
||||
import fcntl
|
||||
import os
|
||||
@ -43,18 +42,6 @@ def set_proc_name(newname):
|
||||
libc.prctl(15, byref(buff), 0, 0, 0)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def mutexfile(filepath):
|
||||
oldumask = os.umask(0o077)
|
||||
try:
|
||||
f = open(filepath, "a")
|
||||
finally:
|
||||
os.umask(oldumask)
|
||||
fcntl.lockf(f.fileno(), fcntl.LOCK_EX)
|
||||
yield
|
||||
f.close()
|
||||
|
||||
|
||||
def unset_cloexec(fd):
|
||||
old = fcntl.fcntl(fd, fcntl.F_GETFD)
|
||||
fcntl.fcntl(fd, fcntl.F_SETFD, old & ~fcntl.FD_CLOEXEC)
|
||||
@ -370,7 +357,6 @@ def main_master():
|
||||
|
||||
saved_stderr = openfdforappend(os.dup(sys.stderr.fileno()))
|
||||
|
||||
with mutexfile(os.path.expanduser("~/.bombshell-lock")):
|
||||
try:
|
||||
p = subprocess.Popen(
|
||||
["qrexec-client-vm", remote_vm, "qubes.VMShell"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user