Bug 8947

Summary: bogus locking mechanism used in redhat scripts
Product: [Retired] Red Hat Linux Reporter: Stig Hackvan <stig-redhat-bugzilla>
Component: manAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-03 14:36:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Stig Hackvan 2000-01-28 20:33:25 UTC
if makewhatis.cron is run by hand and ^C is pressed upon the generation of
an error message {"rec.1: no such file or directory" being the annoying on
ein 6.1} then a lock file gets left behind.  the patch below fixes this an
d probably ought to be applied elsewhere in cron*/*

i suspect that with no pid tied to the lockfile, that lots of users have
bogus lockfiles left behind from reboots and crashes.  either the locking
mechanism needs to be more robust or bogus locks need to get cleaned up...

	stig

--- makewhatis.cron~    Mon Sep 13 17:26:26 1999
+++ makewhatis.cron     Fri Jan 28 11:59:55 2000
@@ -7,7 +7,9 @@
 # them from stepping on each other's toes.  The worst that will
 # happen is that they will temporarily corrupt the database...
 [ -f $LOCKFILE ] && exit 0
+
+trap "rm $LOCKFILE" EXIT
 touch $LOCKFILE
+
 makewhatis -w
-rm -f $LOCKFILE
 exit 0

Comment 1 Bernhard Rosenkraenzer 2000-02-03 14:36:59 UTC
Thanks, fixed.