Operating System - HP-UX
1753591 Members
6269 Online
108796 Solutions
New Discussion юеВ

Re: Back ground process killed on using Ctrl-C

 
SOLVED
Go to solution
Jason bourne_2
Occasional Advisor

Re: Back ground process killed on using Ctrl-C

@Dennis Handly

Yes i did try this out... But wat i see is when Control-C is pressed, the sleep continues in the background but the process still dies out ...Why is this so ...

Is there anyway is could make the process neglect this interrupt signal like by using something like trap or omintr ...Would changing this help me in any manner ...

Thnx for ur reply ...
Dennis Handly
Acclaimed Contributor

Re: Back ground process killed on using Ctrl-C

>the sleep continues in the background but the process still dies out

The sleep continues and then it echoes the message after sleep. So that case works.
Jason bourne_2
Occasional Advisor

Re: Back ground process killed on using Ctrl-C

@ Dennis Handly
Look mine being a menu driven script i need to continue one activty after the other.So what i did was ,i calld this script in the background, which first starts the process in the background and then the sleep of arnd 30 sec in the background.
On doin so i happend to see that when both sleep and my process are running in the background and if i press Control-C , the sleep still continues, but the process dies out.
Hope you understand what i mean ...
Thnx for the reply ...
Dennis Handly
Acclaimed Contributor

Re: Back ground process killed on using Ctrl-C

>the sleep still continues, but the process dies out. Hope you understand what I mean ...

I thought I did but my small example works fine.

Here is where tusc can help you find what's different in your case and my small example.
Did you ever try redirecting stdin to /dev/null?
Jason bourne_2
Occasional Advisor

Re: Back ground process killed on using Ctrl-C

@ Dennis Handly

> Here is where tusc can help you find what's different in your case
Yes i know but i have a problem here.I dont have tusc installed on my server and installing it aint that easy with all the restrictions applied...(but iam still working on getting it installed).Can i use tusc for all versions of HP-Ux ???

>redirecting stdin
Yes i tried that out too ...
If my executable name is :TradexLocMon
arguments are : 2 and 2
then redirecting it to dev/null would be like this rite..
#TradexLocMon trdxdev 2 2 & 0>/dev/null

Well this dint work either :(
Its that the sleep process doesnt seem to have any problem with the interrupt signal ...Just that my process simply wont stay arnd at that time ;)
Thnx for the reply ....
James R. Ferguson
Acclaimed Contributor

Re: Back ground process killed on using Ctrl-C

Hi Jason:

> Can i use tusc for all versions of HP-Ux ???

Binaries for 11.11, 11.23 and 11.31 are available from the HP-UX Porting Centre:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.82/

Installation takes just a minute or two and no reboot is required. The product is installed into '/usr/local/bin' using the standard SD ('swinstall') tools so that it can be tracked like any product ('swlist") and removed ('swremove') if later desired.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Back ground process killed on using Ctrl-C

>then redirecting it to dev/null would be like this right.
#TradexLocMon trdxdev 2 2 & 0>/dev/null

Well you have a typo and I would reorder it as:
TradexLocMon trdxdev 2 2 < /dev/null &