LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-08-2006, 01:16 PM   #1
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Rep: Reputation: 15
Processes close with terminal


I am using Fedora Core 5 with GNOME desktop. I start up a terminal and start a command ( in this case gnome-system-monitor ). When I close the terminal, the system monitor closes along with it.

A quick Google search along the lines of 'process closes with terminal' yielded what I thought would be the solution: backgrounding the process.

So I started the system monitor as below in the terminal.

Code:
gnome-system-monitor &
After pressing 'Enter' I was given the prompt back so it had successfully backgrounded the task ( as far as I aware ).

Even after this, closing the terminal causes gnome-system-monitor to close also and I am unable to find any more methods. I am aware I can make a desktop shortcut to do this but the system monitor is not the only thing I wish to run from the terminal ( and then close it ).

Has anyone else come across this problem and if so, what solution/s are there available? Reference material is, of course, welcomed.
 
Old 07-08-2006, 01:22 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This behaviour is correct.

Every thing started from a terminal is a child from that terminal. Closing the terminal will also kill children.

The nohup command can be used to get around this.

nohup gnome-system-monitor & should do the trick.

Hope this helps.
 
Old 07-08-2006, 01:37 PM   #3
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Original Poster
Rep: Reputation: 15
Thanks for the quick response.

It works excellent, thank you muchly.
Read up the command and now I understand what is happening. Just for reference ( in case anyone wants to know ) it seems when a parent is killed a SIGHUP ( hangup signal ) is sent to the children of that process. 'nohup' causes the created process to ignore this signal.

Again, many thanks.
 
Old 07-08-2006, 01:41 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
By the way, disown lets you say bash or zsh not to send SIGHUP to process. What's the benefit? You can do it any moment after bg-ing job, not before running.
 
Old 07-08-2006, 01:44 PM   #5
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Original Poster
Rep: Reputation: 15
Thanks for your input, that will be very useful no doubt.
 
  


Reply



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
can you close a cd drive from the terminal? dr_zayus69 Linux - Hardware 5 07-04-2021 06:13 AM
How to launch an app in terminal, & keep it running after I close terminal? kornerr Linux - General 7 06-24-2006 05:54 PM
Multiple processes, programs don't close? Influx Slackware 2 10-10-2005 09:55 AM
what happens if I close ssh terminal ? juanb Linux - General 1 09-17-2004 05:15 PM
monitoring active processes and identifying the required processes. gajaykrishnan Programming 2 08-13-2004 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration