Bug 61105 - makewhatis trap fails to exit
makewhatis trap fails to exit
Product: Red Hat Linux
Classification: Retired
Component: man (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: wdovlrrw
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2002-03-13 12:17 EST by Dale Stimson
Modified: 2007-03-26 23:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-03-13 12:17:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dale Stimson 2002-03-13 12:17:16 EST
Description of Problem:

If running /usr/sbin/makewhatis manually, an attempt to terminate
its operation via SIGINT does not exit.  Instead, it just deletes
temp files and continues executing.

The culprit is the statement at line 57:
    trap "rm -rf $TMPFILEDIR" 0 1 2 3 15

If that statement is changed to the following, all is well:
    trap "{ rm -rf $TMPFILEDIR ; exit 255 ; }" 0 1 2 3 15

Version-Release number of selected component (if applicable):

How Reproducible:

Steps to Reproduce:
1. /usr/sbin/makewhatis
2. Let it run for a few seconds, then control-c.

Actual Results:
makewhatis does not exit.  It runs for a while longer and then
complains about missing temp files before finally exiting.

Expected Results:
makewhatis should exit.  The temp files should be deleted.
This is what happens with the change I suggested above.

Additional Information:
Comment 1 Bernhard Rosenkraenzer 2002-03-25 09:17:27 EST
Right. Fixed in 1.5j-6.
Comment 2 Matthew Saltzman 2002-12-07 16:50:16 EST
This fix apparently never made it into distribution, as it does not appear in
man-1.5j-6 (7.3) or man 1.5j-11 (8.0):

  # make sure TMPFILEDIR is deleted if program is killed or terminates
  # (just delete this line if your shell doesnt know about trap)
  trap "rm -rf $TMPFILEDIR" 0 1 2 3 15

The indicated failure to terminate on ^C also persists.

Note You need to log in before you can comment on or make changes to this bug.