LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-15-2008, 04:41 AM   #1
Niraj Kulkarni
Member
 
Registered: May 2008
Posts: 47

Rep: Reputation: 15
Ctrl-C kills background process also


Hi ,
I am working on uClinux 2.4.24 on ARM processor. Whenever I run some application in background (unsing "&" , for eg "ping 172.16.3.119 &")and press Ctrl-C , the background process also gets killed.
To my understanding Ctrl-C must kill only the foreground process.
What do i do so that Ctrl-C will not kill my background process.
Niraj
 
Old 12-15-2008, 05:10 AM   #2
binary_pearl
Member
 
Registered: Jul 2007
Location: Chicago Illinois
Distribution: SLES 10 SP2/SP3, SLES 11 SP1, OpenSUSE, Sabayon, Gentoo, Fedora 14, RHEL 3/4/5/6
Posts: 98
Blog Entries: 1

Rep: Reputation: 23
Try the command: `nohup`

So you run it like this:
nohup some_command

Output will go to a file called nohup.out

--Shaun
 
Old 12-15-2008, 05:29 AM   #3
Niraj Kulkarni
Member
 
Registered: May 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Thanks shaun
But there is no "nohup" command for my uClinux. Or else i will have to get source code for that command , compile it for my ARM processor (ARM ELF big-endian executable) and then use it.
Any other way...
 
Old 12-15-2008, 06:11 AM   #4
binary_pearl
Member
 
Registered: Jul 2007
Location: Chicago Illinois
Distribution: SLES 10 SP2/SP3, SLES 11 SP1, OpenSUSE, Sabayon, Gentoo, Fedora 14, RHEL 3/4/5/6
Posts: 98
Blog Entries: 1

Rep: Reputation: 23
Do you have the command: `setsid` ?

That seemed to work for me also. If you don't have that, then the only other thing I can think of is to write a wrapper around the commands that you are using and trap ctrl-c. I would use this is a last resort though.

--Shaun
 
  


Reply

Tags
kills, process


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the process ID of process executing in the background akeneche Linux - Newbie 1 01-03-2008 10:08 AM
ctrl+backspace kills the X server crisostomo_enrico Solaris / OpenSolaris 12 09-22-2007 01:17 PM
[C++] Run in background when Ctrl+C entered TomGibbons Programming 4 08-26-2006 08:51 AM
Ctrl+Alt+Backspace kills computer nomicon Slackware 7 02-16-2005 08:24 AM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 12:27 AM


All times are GMT -5. The time now is 04:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration