From bc6f8b99dc38cff5786962789ffe0a8e544d58e6 Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Wed, 20 Jan 2021 15:12:58 +0100 Subject: [PATCH] Run star without fifo, to ensure correct termination --- secondary.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/secondary.py b/secondary.py index e816932..3b1bf39 100644 --- a/secondary.py +++ b/secondary.py @@ -55,15 +55,13 @@ class Backup: self.trash_root = os.path.join(mount, 'TRASH').encode('utf-8') self.trash = os.path.join(self.trash_root, str(int(time.time())).encode('utf-8')) - extract_cmd = [ '/bin/star', '-x', '-nowarn', '-no-statistics' ] - try: - self.extract = subprocess.Popen(extract_cmd, - cwd=os.path.join(mount, path), - stdin=self.primary_out) - atexit.register(cond_kill, self.extract) - except: - print('EXIT', file=sys.stderr) - exit(1) + extract_cmd = [ '/bin/star', '-x', '-no-fifo', + '-nowarn', '-no-statistics' ] + self.extract = subprocess.Popen(extract_cmd, + cwd=os.path.join(mount, path), + stdin=self.primary_out) + atexit.register(cond_kill, self.extract) + # Make sure that the generated star archive is not empty self.primary_in.write(b'.\0') @@ -159,7 +157,6 @@ def do_backup(hash_name, options, socket_path, mount, path): status = Status(log) config_path = '%s/TOTALBACKUP.config' % (mount) - if not os.path.exists(config_path): raise Exception('"%s" does not exists' % (config_path)) -- GitLab