Bug 140202 - makewhatis trap (control-c, et. al) fails to exit (redux)
makewhatis trap (control-c, et. al) fails to exit (redux)
Product: Fedora
Classification: Fedora
Component: man (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2004-11-20 21:01 EST by Dale Stimson
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-17 08:01:42 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 2004-11-20 21:01:36 EST
This was originally reported in March 13, 2003 as bug # 61105.
It was fixed as recommended in rawhide and closed.  Subsequently, the
fix disappeared.

The problem still/again exists.

Reported against man-1.5o1-7 from FC3 errata, but I'm sure present
before that, probably ever since RHL 7.2.

Description of Problem:

If running /usr/bin/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/sin/makewhatis
2. Let it run for a few seconds, then control-c.

Actual Results:
makewhatis does not exit.  It continues running but with its temp file

Expected Results:
makewhatis should exit.  The temp files should be deleted.
This is what happens with the change I suggest above.
Comment 1 Ivana Varekova 2005-03-16 04:27:10 EST
Thank you for your notice.
It was be fixed (in man-1.5p-2).
Ivana Varekova
Comment 2 Gilles Detillieux 2005-05-10 13:44:10 EDT
A better way of handling the traps would be as follows:

   trap "rm -rf $TMPFILEDIR" 0
   trap "exit 255" 1 2 3 15

That way, you don't force a 255 exit code when the program would otherwise exit
normally.  The rm command will be run whenever the script exits, whether a
normal exit or the exit resulting from the trap placed on the four signals above.
Comment 3 Ivana Varekova 2005-05-11 05:31:49 EDT
You are right your solvation is better, I change it in new version (1.5p-6). 
Thank you for your notice.
Ivana Varekova

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