Closing the terminal results in closing of application started by the terminal even if the processes is backgrounded

Polytropon freebsd at edvax.de
Sat Aug 23 14:03:30 UTC 2008


On Sat, 23 Aug 2008 13:36:32 +0530, "Siju George" <sgeorge.ml at gmail.com> wrote:
> Hi,
> 
> I started Firefox from an xterm.
> Then I pressed <ctrl> +Z
> And the I typed bg to background Firefox process.
> But when I close xterm firefox also closes.
> Why is that?

When the terminal application (xterm) is closed, the shell (csh)
contained in this terminal session closes as well, and it causes
all processes that run in this shell (firefox) to close as well
via a signal (SIGHUP).

Suspending (Ctrl+Z) and returning background jobs (bg) does not
matter to the Firefox browser, it keeps running as long as the
shell it has been started from is running.

In order to prevent firefox from being closed when the starting
terminal session is closed, start it via

	% firefox &

It will then eventually put status messages to this xterm, but
the shell is free again to accept commands.

Another possibility would be to use detach (from the ports), but
this program is usually used when you want to keep running a program
after you've logged out.



-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list