Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2008 16:03:26 +0200
From:      Polytropon <freebsd@edvax.de>
To:        "Siju George" <sgeorge.ml@gmail.com>
Cc:        freebsd list <freebsd-questions@freebsd.org>
Subject:   Re: Closing the terminal results in closing of application started by the terminal even if the processes is backgrounded
Message-ID:  <20080823160326.7b19f81c.freebsd@edvax.de>
In-Reply-To: <b713df2c0808230106l38e4a715rd26b0bab3f36df20@mail.gmail.com>
References:  <b713df2c0808230106l38e4a715rd26b0bab3f36df20@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 23 Aug 2008 13:36:32 +0530, "Siju George" <sgeorge.ml@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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080823160326.7b19f81c.freebsd>