trap 2 on /etc/profile

Greg Comeau greg at csanta.UUCP
Mon Sep 12 22:50:40 AEST 1988


In article <349 at whizz.UUCP> bbh at whizz.UUCP (Bud Hovell) writes:
>
> ...[ discussion of `trap' commands in /etc/profile in their influence on
>   Informix SQL ] ...
>

The three traps in my /etc/profile:

 1) trap '' 1 2 3
 2) trap "exit" 1 2 3
 3) trap 1 2 3

look the same as yours.  They mean:

 1) ignore signals 1 (hangup), 2 (interrupt), and 3 (quit).
 2) if signal 1, 2, or 3 is recieved, then run the `exit' command.
 3) *reset* signals 1, 2, and 3 to the original values they had when
    the given shell was entered.

respectively.  This does not appear to negate anything said by Kernighan
in The UNIX Programming Environment. ??

Also, note that (3) does not disable *or* enable signals specified, something
like (1) or `trap "" 1 2 3' does that. (3) only serves to reset...

> However, I must stand by the basic facts offered: with the trap 2 command,
> my 610 terminal and console completely loose the <del> key function when they
> go into Informix SQL, and this problem is eliminated (with no apparent side
> effects) by removing them. (Informix disclaims any knowledge).

Fine.  If that is the case, then Informix SQL expect the signals to be
a certain way (and it can check them and do certain thing based on their
values which *seems* to be the case here... why I don't know..).
Do not however change this in /etc/profile, but change it in each user's
.profile file.  Or better yet, make a shell script that does the correct
trap and then `exec's informix and tell the users not to run informix directly.
You can enforce this by renaming the original binary...



More information about the Unix-pc.bugs mailing list