LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   detaching a (graphical)process invoked without "&" from terminal (http://www.linuxquestions.org/questions/programming-9/detaching-a-graphical-process-invoked-without-and-from-terminal-812537/)

deepclutch 06-06-2010 03:37 PM

detaching a (graphical)process invoked without "&" from terminal
 
Hello,
If I run a graphical(or any process) process like music player "exaile" from terminal ,Is there a way without using "nohup" or "screen"(terminal multiplexer) to detach "exaile " from the terminal when ran without appending "&" on to exaile(like "exaile &").
If I press CTRL-Z to stop ,some programs errs out , "watch dog time out" and "aborts" the process. :(

The problem is bg,disown or jobs etc does not list the process if I ran from another terminal.

I want to know ways by Which I can detach a graphical/non-graphical process from a terminal as well as to re-attach to the terminal.

Thanks

paulsm4 06-06-2010 05:51 PM

1. Remember to start with "&" (or, better, "nohup XYZ &")
... or ...
2. <Ctl-Z>, bg

deepclutch 06-07-2010 09:20 AM

I knew of CTRL-Z(Stop) and "do bg 1" .
Code:

^Z
[1]+  Stopped                gxine
prakash@dcbox:~$ bg 1
[1]+ gxine &
prakash@dcbox:~$
(gxine:3464): Gdk-WARNING **: gdk_window_set_user_time called on non-toplevel

prakash@dcbox:~$

^^^^ and it works also.then,I can "exit".

Another solution to exit terminal after having the process moved to background ,is to type :
Code:

disown -h & exit
now,the process id(pid) of gxine is not "1"(as expected);but it has changed -for eg,here gxine has pid of "3796"
--
As regarding catching program running on background to another terminal ,I tried "fg 1" ,but which tells "bash: fg: 1: no such job" or pid of gxine(My example) :
"bash: fg: 3796: no such job" :( ,but the process is not attched to the newly invoked terminal.Any use of "disown -h" while doing "bg 1" ?How Will it be possible to attach the process to current terminal?

Thanks For the Replies :)


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