BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000994 [BusyBox] Networking Support minor always 08-15-06 15:31 02-14-08 09:10
Reporter deeptho View Status public  
Assigned To BusyBox
Priority normal Resolution no change required  
Status closed   Product Version 1.2.x
Summary 0000994: when a trap command is set, shell script ignores signals nor from parent
Description The following script hangs up with
 kill -HUP %1
from the current shellm but not
with
 kill -HUP <processid> from another shell.

Without the trap, it does react to signals
from another shell, but of course it does not run
the signal handler.

This is a bug, right? Is there any way to make
the script handle a signla sent from another shell>


#!/bin/sh

cleanup ()
{
    echo "cleaning"
}
trap cleanup HUP

echo "sleeping "
sleep 100000
echo "done"
Additional Information
Attached Files

- Relationships

- Notes
(0001567)
deeptho
08-15-06 15:32

This should of course not have been filed under "networking support".
Sorry for that.
 
(0004724)
vda
02-14-08 09:10

I see absolutely the same behavior with bash. testcase.sh is chmod'ed 755:

#!/bin/sh
cleanup() {
    echo "cleaning"
}
trap cleanup HUP
echo "sleeping, pid $$"
sleep 100000
echo "done"

I run it as "./testcase.sh &" in bash or ash. Then "kill -HUP %1" from the same shell kills testcase.sh and causes these messages to appear:

cleaning
done

whereas "kill -HUP <pid>" from another shell does not, and "jobs" shows that testcase.sh is still running.

Strace shows that bash simply ignores HUP:

waitpid(-1, 0xfff4ff7c, 0) = ? ERESTARTSYS (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
sigreturn() = ? (mask now [CHLD])
waitpid(-1,

I don't know whether this ash behavior is standard compliant or not, but it is the same as bash.
 

- Issue History
Date Modified Username Field Change
08-15-06 15:31 deeptho New Issue
08-15-06 15:31 deeptho Status new => assigned
08-15-06 15:31 deeptho Assigned To  => BusyBox
08-15-06 15:32 deeptho Note Added: 0001567
08-15-06 15:39 deeptho Issue Monitored: deeptho
02-14-08 09:10 vda Status assigned => closed
02-14-08 09:10 vda Note Added: 0004724
02-14-08 09:10 vda Resolution open => no change required


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker