bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trapping signal does not work correctly on subsequent shell scrip ts


From: NagyT
Subject: trapping signal does not work correctly on subsequent shell scrip ts
Date: Mon, 7 Jun 2004 16:59:44 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux
Compiler: gcc -I/usr/src/packages/BUILD/bash-2.05
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i386-suse-linux'
-DCONF_VENDOR='suse' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64
-I. -I/usr/include -I. -I./include -I./lib -I/usr/include -O2
-march=i486 -mcpu=i686 -D_GNU_SOURCE -Wall -pipe
uname output: Linux dell632 2.4.20 #4 SMP Fri Jan 10 12:07:00 CET 2003
i686 unknown
Machine Type: i386-suse-linux

Bash Version: 2.05
Patch Level: 0
Release Status: release

Description:

Something is wrong on trapping signal on subsequent shell scripts if
CTRL-C is pressed at the terminal.

Repeat-By:

Start the attached a.sh. It starts b.sh, which starts c.sh, which starts
sleep 1000. Send a SIGQUIT signal to a.sh. The following output is seen:

address@hidden:~/tmp/signal(1076)>./a.sh
a.sh(21704): waiting for b.sh(21705)...
b.sh(21705): waiting for c.sh(21706)...
c.sh(21706): waiting for sleep(21707)...# kill 21704 at this point
a.sh: signal received(kill 21705)
b.sh: signal received(kill 21706)
c.sh: signal received(kill 21707)
address@hidden:~/tmp/signal(1077)>

This the expected situation. But if I press simply CTRL-C, I get the
following output:

address@hidden:~/tmp/signal(1077)>./a.sh
a.sh(23707): waiting for b.sh(23708)...
b.sh(23708): waiting for c.sh(23709)...
c.sh(23709): waiting for sleep(23710)...
a.sh: signal received(kill 23708)
address@hidden:~/tmp/signal(1078)>

I do not understand why only a.sh prints "signal received" text.
Furthermore c.sh and the sleep command are kept running.




------------------------------------------------------------------------------------------- 
Ez az üzenet, s bármely melléklete bizalmas információkat tartalmazhat és kizárólag a címzettnek szól.
Amennyiben nem Ön ennek az üzenetnek a címzettje, kérjük azonnal értesítse a feladót,
s az üzenetet törölje a rendszeréből.

This message and any attachment may be confidental and intended exclusively for the addresse.
If you are not the intended addresse please notify the sender immediately
and delete this message and any attachment from your system.
     

 

Attachment: a.sh
Description: Bourne shell script

Attachment: b.sh
Description: Bourne shell script

Attachment: c.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]