Sponsored Content
Full Discussion: Trapped Signal HUP
Top Forums UNIX for Advanced & Expert Users Trapped Signal HUP Post 302262410 by RAMESHPRABUDASS on Thursday 27th of November 2008 07:28:32 AM
Old 11-27-2008
Bug 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.

Last edited by RAMESHPRABUDASS; 11-27-2008 at 08:36 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Hup

I am curious about HUP..... kill -HUP pid What exactly does it do?? Does it stop the process and restart it from the beginning or from where it stopped? Thanks (6 Replies)
Discussion started by: jwbrown
6 Replies

2. UNIX for Dummies Questions & Answers

samba, swat. how to send a HUP to inetd ?

solaris can't support pkill command:( (2 Replies)
Discussion started by: cloudsmell
2 Replies

3. Linux

syslog hup

Hi All, I modified /etc/syslog.conf and execute kill -HUP syslogd_PID. There's nothing changes on the PID when I did ps -ef|grep syslogd. It's the same. Do you think it restarted the process of syslogd? Thanks in advance. (3 Replies)
Discussion started by: itik
3 Replies

4. Shell Programming and Scripting

Killed by signal 15.

Hi all I have Master script, Main script ,and 4 Child script. Master.sh #!/bin/bash /export/home/user/Main.shMain.sh #!/bin/bash /export/home/user/Child1.sh & /export/home/user/Child2.sh & /export/home/user/Child3.sh & /export/home/user/Child4.sh &I run only Master.sh script... (1 Reply)
Discussion started by: almanto
1 Replies

5. UNIX for Dummies Questions & Answers

Help with HUP and SEGV.

Hello - I need to know the detail of HUP and SEGV. I know HUP is Hangup and can be use to kill a Unix login session remotely by sending a hangup signal to the process running the login session. Could someone tell me in detail prupose of HUP and SEGV (segmentation violation)? I need to... (1 Reply)
Discussion started by: namasteall2000
1 Replies

6. Shell Programming and Scripting

Trapped in pipe

Hi Is there any way to find out in a single step ( command) the step where the pipe command failed when using multiple commands using pipe . eg : ll *.tar | grep dec | grep december.tar the first step is listing all tar files . Second step constitutes piping that data and doing grep... (5 Replies)
Discussion started by: ultimatix
5 Replies

7. Solaris

sudo for permission kill -HUP

Hi, I'm trying to provide "/usr/bin/kill -HUP" command to one of the user using sudo file. I have configured sudo as following: $cat /etc/sudoers User_Alias AA=conadmin Cmnd_Alias KILL1=/usr/bin/kill -HUPAA ALL=NOPASSWD:KILL1 When I login as the user and execute 'sudo -l' command, it... (2 Replies)
Discussion started by: mohzub
2 Replies

8. UNIX for Advanced & Expert Users

need more user signal

Hi In my program I have already used both SIGUSR1 SIGUSR2 user signals. I need another one. How can I do that? Thank you Naama (1 Reply)
Discussion started by: naamabm
1 Replies

9. UNIX for Dummies Questions & Answers

Trying to block signal

I have this code that doesnt do what it is suppose to do. It should block signal that I send while process is running. I press control+z while this process is running and it should be blocked but it isnt. When i press control+z it gives me this.... + Stopped When I change SIGTSP into SIGINT then... (5 Replies)
Discussion started by: joker40
5 Replies

10. Shell Programming and Scripting

Signal trapped during read resumes sleeping

Greetings. This is my first post in this forum; I hope y'all find it useful. One caveat: "Concise" is my middle name. NOT! :D I am almost done with a shell script that runs as a daemon. It monitors a message log that is frequently written to by a database server but it it works my client will... (2 Replies)
Discussion started by: jakesalomon
2 Replies
hatimerun(1M)						  System Administration Commands					     hatimerun(1M)

NAME
hatimerun - run child program under a timeout SYNOPSIS
/usr/cluster/bin/hatimerun -t timeOutSecs [-av] [-e exitcode] prog args /usr/cluster/bin/hatimerun -t timeOutSecs [-v] [-e exitcode] [-k signalname] prog args DESCRIPTION
The hatimerun utility provides a convenient facility for timing out the execution of another child, program. It is useful when programming in scripting languages, such as the Bourne shell. See sh(1). The hatimerun utility runs the program prog with arguments args as a child subprocess under a timeout, and as its own process group. The timeout is specified in seconds, by the -t timeOutSecs option. If the timeout expires, then hatimerun kills the child subprocess's process group with a SIGKILL signal, and then exits with exit code 99. You can run this command in the global zone or in a non-global zone. The command affects only the global or non-global zone in which you issue the command. OPTIONS
The following options are supported: -a Changes the meaning of hatimerun radically: instead of killing the child when the timeout expires, the hatimerun utility sim- ply exits, with exit code 99, leaving the child to run asynchronously. It is illegal to supply both the -a option and the -k option. -e Changes the exit code for the timeout case to some other value than 99. -k Specifies what signal is used to kill the child process group. The possible signal names are the same as those recognized by the kill(1) command. In particular, the signal name should be one of the symbolic names defined in the <signal.h> descrip- tion. The signal name is recognized in a case-independent fashion, without the SIG prefix. It is also legal to supply a numeric argument to the -k option, in which case that signal number is used. It is illegal to supply both the -a option and the -k option. -t Specifies the timeout period, in seconds. -v Verbose output, on stderr. EXIT STATUS
If the timeout occurs, then hatimerun exits with exit code 99 (which can be overridden to some other value using the -e option). If the timeout does not occur but some other error is detected by the hatimerun utility (as opposed to the error being detected by the child program), then hatimerunhatimerun exits with exit code 98. Otherwise, hatimerun exits with the child's exit status. The hatimerun utility catches the signal SIGTERM. It responds to the signal by killing the child as if a timeout had occurred, and then exiting with exit code 98. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
kill(1), sh(1), attributes(5) Sun Cluster 3.2 10 Apr 2006 hatimerun(1M)
All times are GMT -4. The time now is 02:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy