summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg27
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index 0e5db5161..bbdbba68d 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -275,8 +275,11 @@ class Client:
if not self.setup['omit-lock-check']:
#unlock here
if lockfile:
- fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
- os.remove(LOCKFILE)
+ try:
+ fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
+ os.remove(LOCKFILE)
+ except OSError:
+ self.logger.error("Failed to unlock lockfile %s" % lockfile.name)
if not self.setup['file']:
# upload statistics