From e7b70c8f7b3e3787547409449f7488e18765cc14 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 4 Oct 2011 20:44:43 +0200 Subject: [PATCH] [sulfur] try to acquire Entropy locks for at most 5 seconds before giving up --- sulfur/src/sulfur/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sulfur/src/sulfur/__init__.py b/sulfur/src/sulfur/__init__.py index 725d4eca3..235282b68 100644 --- a/sulfur/src/sulfur/__init__.py +++ b/sulfur/src/sulfur/__init__.py @@ -38,6 +38,7 @@ if "/usr/lib/entropy/client" not in sys.path: if "/usr/lib/entropy/sulfur" not in sys.path: sys.path.insert(4, "/usr/lib/entropy/sulfur") + from entropy.exceptions import OnlineMirrorError, PermissionDenied import entropy.tools from entropy.const import etpConst, const_get_stringtype, \ @@ -92,7 +93,8 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin): if resources_locked: locked = True else: - locked = not entropy.tools.acquire_entropy_locks(self._entropy) + locked = not entropy.tools.acquire_entropy_locks(self._entropy, + max_tries = 5) self._effective_root = os.getuid() == 0 if self._effective_root: self._privileges.drop()