A couple of questions about command line usage
Hi!
I've got a couple questions about command line usage: 1) If I run an xterm, then run an app from it, say firefox, forking the process at the same time ( firefox & ); I will not be able to terminate this xterm without terminating firefox at the same time. Is it possible to alter this behaviour so that it is possible to close the terminal without closing the program ran from it? 2) Is it possible to suppress *all* output from a program? The standard "> /dev/null" does not seem to be removing all the output in all conditions. Thanks in advance ;) |
Quote:
Quote:
|
Quote:
FWIW, if you need to keep a console program running after closing the terminal, look at Screen (you should have it installed). |
Quote:
Quote:
|
Quote:
Quote:
|
Some apps detach themselves from shell, as Firefox does. Firefox forks into firefox-bin and then it disappears.
|
I've tested with Firefox, Thunderbird, and gxine, and they all continue to work, although the parent process changes. Maybe this is a behavior of Konsole, as opposed to plain xterm?
Code:
(shell 1) |
BTW - you could also try preceding your command with "nohup".
|
Quote:
Quote:
|
No need to resort to Screen for this (although you should look into it
anyway). What you want is "disown." For example, if I start a process from the shell, I can then just enter "disown". Which shell are you using? You may have more than one available. Check the documentation for the shell you're using under "job control." Joel |
"disown" or "disown -h" should to the trick as well, as should "shopt -u huponexit". Actually this has the whole story, for bash at least. Lookup "disown", "huponexit" and "SIGHUP".
|
Open /usr/bin/firefox. And see. It is not Firefox web browser, it's a shell script. I told you, it detachs firefox-bin from terminal. Do a pstree with Firefox started and see who's its parent. When parent dies, children die - no exception.
|
Quote:
|
Yeah, it's wrong... I apologize :) It was the heat of the moment :)
|
No worries - I learned I lot myself between post#2 and post#11 :-)
|
All times are GMT -5. The time now is 04:23 AM. |