Trapped Signal HUP

We encountered an issue in our project while using the Interix UNIX (SFU 3.5) and explained our query below. We would be happy if anybody helps us to troubleshoot the problem J

In our code the trapping signal for all signals like HUP, INT, QUIT, ILL, TRAP, ABRT, EXCEPT, etc., is initialized in the main script. This main script calls the various executable codes and shell scripts which are mostly used to connect the ACR data base and transfer the files from local machine to remote machine.

While execution of our code sometimes we received message like Trapped Signal HUP and sometimes it was executing fine. Could any of you please explain us, why we have received message Trapped Signal HUP in some occurrences and not in some other times for the same executables?

For example,

trap_function()
{
SIGNAL=$1
echo Trapped signal $SIGNAL >> $HOME/Trap.log
trap - $SIGNAL
kill -$SIGNAL $MYPID
}

for SIGNAME in \
HUP \
INT \
;;;;
XCPU \
XFSZ
do
trap "trap_function $SIGNAME" $SIGNAME
done

MYPID=$$

./script1.sh &
./script2.sg &
./script3.sh &
........
......
./exe1 &
.....
./script30.sh &
./exe5 &

Note:All log files which sizes are greater than 200kb will be taken backup.

Signal HUP is generated when the terminal on which the process is running gets disconnected.

You may get this message depending on the network conditions and how you run thsi script.

SIGHUP only goes to the script you wrote when the terminal (with CLOCAL flag set) disconnects or if you send the script process itself a SIGHUP. The trap works in this case.

If SIGHUP is sent directly to the child process it terminates - for example with kill -HUP <pid>, your trap is not executed.

Hi,
The script called from some other script.

we would like to know,what are the various reason to receive HUP signal.

This information is in many books and google, wikipedia.

Is there a more specific question then this? Thanks.