- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Back ground process killed on using Ctrl-C
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 02:25 AM
тАО06-29-2009 02:25 AM
I have this menu driven script of mine,which i have written on bash shell.There is this option on my menu where i start 2 set of process in the background.Now when i choose the proper exit option from my menu,i dont encounter any problems.But the moment i press Ctrl-C , these background processes get killed.I have tried a lots of option like nohup,onintr,trap,and even tried wrapping my executable call in csh so that the background process does not get the interrupt signal.I also ran through the HP UX manual ,but that dint help me much.Kindly help me in solving this issue.....
Solved! Go to Solution.
- Tags:
- SIGINT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 02:40 AM
тАО06-29-2009 02:40 AM
SolutionProcess management in Posix/HP-UX is different than bash.
http://docs.hp.com/en/5965-4642/5965-4642.pdf
Posix asynchronous I/O (maybe not related.
http://docs.hp.com/en/B9106-90012/ix01.html
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 03:11 AM
тАО06-29-2009 03:11 AM
Re: Back ground process killed on using Ctrl-C
Have you tried using a real shell?
>But the moment I press Control-C, these background processes get killed.
I suppose you could write a SIGINT handler.
>I have tried a lots of option like nohup
I guess that only handles SIGHUP.
If you look at termio(7), it says:
Generates a SIGINT signal which is sent to all processes in the foreground process group for which the terminal is the controlling terminal.
I would have thought that excluded your background processes. But you may have to change them to demons so they aren't affected by the control-C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 03:22 AM
тАО06-29-2009 03:22 AM
Re: Back ground process killed on using Ctrl-C
So what exaclty do u say i do to get this problem solved.I want this process to be started through my script itself.Should i change the shell that i am working on,would that help me ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 03:37 AM
тАО06-29-2009 03:37 AM
Re: Back ground process killed on using Ctrl-C
> So what exaclty do u say i do to get this problem solved
I would change your script to use the Posix shell and verify that the behavior you want is achieved (it should be). This may be the simplest solution and brings your script in line with HP-UX standards, too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 04:07 AM
тАО06-29-2009 04:07 AM
Re: Back ground process killed on using Ctrl-C
It might be helpful if you could decompose your script into a small one that fails in your hands and then post that here. I cannot reproduce your problem on a Linux box (for what that's worth).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 04:16 AM
тАО06-29-2009 04:16 AM
Re: Back ground process killed on using Ctrl-C
I assume you are redirecting stdout and stderr. Are you redirecting stdin to /dev/null?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 06:23 AM
тАО06-29-2009 06:23 AM
Re: Back ground process killed on using Ctrl-C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 06:48 AM
тАО06-29-2009 06:48 AM
Re: Back ground process killed on using Ctrl-C
A simple test case is preferred. That said, this statement:
# nohup TradexLocMon trdxdev 2 2 & >>/dev/null
...should probably be:
# nohup TradexLocMon trdxdev 2 >/dev/null 2>&1 &
...which says to run 'TradeexLocMon' as a hangup immune process in the background, passing two arguments ("trdxdev" and "2"). Redirect any STDOUT and STDERR to '/dev/null'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 08:15 AM
тАО06-29-2009 08:15 AM
Re: Back ground process killed on using Ctrl-C
Perhaps I misunderstood. You said that your last attachment was ..."the script that i call from my option ...".
To start _that_ script in the background you would want to call it as I showed; something like:
# nohup /oath_to_script arg1 arg2 arg3 < /path_to_input > /path_to_output 2>&1 &
The '/path_to_input' and/or '/
path_to_output' can be '/dev/null; if necessary.
Regards!
...JRF...