LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-06-2010, 04:37 PM   #1
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Rep: Reputation: 32
Post 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

Last edited by deepclutch; 06-06-2010 at 05:04 PM.
 
Old 06-06-2010, 06:51 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
1. Remember to start with "&" (or, better, "nohup XYZ &")
... or ...
2. <Ctl-Z>, bg
 
Old 06-07-2010, 10:20 AM   #3
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
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
 
  


Reply

Tags
bg, detach, fg, jobs


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
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 05:23 AM
glibc 2.9 "make check" fails on rt/tst-cputimer with "timer sig[12] invoked to soon" shachter Linux - Software 2 02-14-2009 02:24 PM
"Graphical Terminal-Session" from Windows to Linux mwildam Linux - Desktop 14 09-19-2006 06:23 PM
"kdesu" daemon gives error message & all terminal emulators hang hari_seldon99 Mandriva 0 07-28-2004 05:30 AM
"kdesu" daemon gives contradictory error message & all terminal emulators hang hari_seldon99 Linux - General 0 07-24-2004 04:42 PM


All times are GMT -5. The time now is 02:54 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