Bug 140202 - makewhatis trap (control-c, et. al) fails to exit (redux)
Summary: makewhatis trap (control-c, et. al) fails to exit (redux)
Alias: None
Product: Fedora
Classification: Fedora
Component: man   
(Show other bugs)
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2004-11-21 02:01 UTC by Dale Stimson
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-17 13:01:42 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Dale Stimson 2004-11-21 02:01:36 UTC
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 09:27:10 UTC
Thank you for your notice.
It was be fixed (in man-1.5p-2).
Ivana Varekova

Comment 2 Gilles Detillieux 2005-05-10 17:44:10 UTC
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 09:31:49 UTC
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.