You are not logged in.

#1 2013-12-26 18:14:42

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Cannot quit xterm when process is running in background

Hi,

I have what is perhaps a dumb question.  I am using XMonad as a window manager and I have the launching of some applications bound to aliases.  For example, firefox="firefox &".  This will launch firefox in the foreground and allow me to continue using the xterm. 

Up until maybe a week or two ago, if I typed "exit" in that xterm, the xterm would quit and firefox would continue running in the foreground.  Now, when I type "exit" the terminal will hang until I quit firefox.  Does anybody have a clue as to why this would actually occur?  The firefox process has clearly been launched into the background using UNIX job control, as I can interact with the terminal.  I appreciate you taking the time to answer my question :-)

Dan

Last edited by dsulli99 (2013-12-27 20:27:25)

Offline

#2 2013-12-26 18:25:42

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Cannot quit xterm when process is running in background

My understanding is that processes run with background processes are still tied to the terminal. So you shouldn't be able to close the terminal with background processes still running. Or, as is the case for me with xfce4-terminal, closing the terminal closes the background process. IOW, the behaviour you used to see seems like the oddity to me.

Edit: Should really read sentences after I change them to ensure they still make sense...

Last edited by alphaniner (2013-12-26 19:05:27)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2013-12-26 18:28:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Cannot quit xterm when process is running in background

Still works for me. Have you tried just typing 'firefox &' instead of using the alias?
If you want a launcher, try e.g. dmenu: https://wiki.archlinux.org/index.php/Xm … plications

Offline

#4 2013-12-26 19:05:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Cannot quit xterm when process is running in background

Please edit your first post and choose a title that more accurately reflects your issue: this will be more useful for anyone else searching on the same topic:
https://wiki.archlinux.org/index.php/Fo … ow_to_Post


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-12-26 19:19:03

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Cannot quit xterm when process is running in background

I would use:

nohup firefox >/dev/null & disown

-- edit: Actually, the following would probably work better:

setsid firefox

Last edited by Stebalien (2013-12-26 19:24:14)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#6 2013-12-27 20:32:06

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: Cannot quit xterm when process is running in background

karol wrote:

Still works for me. Have you tried just typing 'firefox &' instead of using the alias?

Yep.  Still hangs while firefox is in the foreground.

If you want a launcher, try e.g. dmenu: https://wiki.archlinux.org/index.php/Xm … plications

Thank you for the suggestion.  I'd still like to get this working with xterm, though :-)

Offline

#7 2013-12-27 20:32:55

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: Cannot quit xterm when process is running in background

jasonwryan wrote:

Please edit your first post and choose a title that more accurately reflects your issue: this will be more useful for anyone else searching on the same topic:

Done.  Sorry about that.

Offline

#8 2013-12-27 20:38:00

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: Cannot quit xterm when process is running in background

I do similar to Stebalien when I want this behavior:

firefox & disown

Just have to disown process and then you won't have running jobs in the background.

Offline

#9 2013-12-27 20:45:20

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: Cannot quit xterm when process is running in background

This works thank you :-)

nohup firefox >/dev/null & disown

This does not work

setsid firefox

Offline

#10 2013-12-27 20:46:20

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: Cannot quit xterm when process is running in background

This does not work, thank you for your reply, though.

firefox & disown

Offline

Board footer

Powered by FluxBB