From 0632f09bff64060b99bfacc445917bdf3f43200c Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 8 Apr 2022 21:29:31 +0200 Subject: [PATCH] rhel8 ignores flock and kills us anyways --- scripts/sfx.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/sfx.py b/scripts/sfx.py index 479998e9..4723a0da 100644 --- a/scripts/sfx.py +++ b/scripts/sfx.py @@ -342,14 +342,15 @@ def get_payload(): def utime(top): + # avoid cleaners i = 0 files = [os.path.join(dp, p) for dp, dd, df in os.walk(top) for p in dd + df] - while WINDOWS: + while WINDOWS or os.path.exists("/etc/systemd"): t = int(time.time()) if i: msg("utime {}, {}".format(i, t)) - for f in files: + for f in [top] + files: os.utime(f, (t, t)) i += 1 @@ -374,16 +375,6 @@ def run(tmp, j2, ftp): msg("sfxdir:", tmp) msg() - # block systemd-tmpfiles-clean.timer - try: - import fcntl - - fd = os.open(tmp, os.O_RDONLY) - fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) - except Exception as ex: - if not WINDOWS: - msg("\033[31mflock:{!r}\033[0m".format(ex)) - t = threading.Thread(target=utime, args=(tmp,)) t.daemon = True t.start()