From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Background processes prevent terminal window from closing
Date: Thu, 05 May 2011 04:43:00 -0000 [thread overview]
Message-ID: <BANLkTinhUwnY31oeQipoVaS8nRtC6=Hikw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin2LqmSCJ8CdjSCNLTiPO8_sOknpg@mail.gmail.com>
On 5 May 2011 05:30, Ryan Dortmans wrote:
> Hi,
>
> I have found that background processes prevent the terminal window
> from closing. I have tried with the cmd terminal as well as mintty.
> Here is a simple example:
>
> $ notepad .profile &
> [1] 10260
> $ exit
> logout
>
> The window remains until I close the notepad window. I have also
> reproduced the issue using a simple looping shell script instead of a
> windows program.
>
> I thought that running disown would detach the process to turn it into
> a daemon, but this has no effect.
No, this just removes it from the shell's job control, but it still
remains connected to the terminal session.
> Is there any way to detach running background processes such that the
> terminal can be closed?
You can start a program in a separate session using the 'setsid'
utility from the util-linux package. I don't know whether it's
possible to detach a running process.
You can close the terminal anyway though using the Close button (or
Alt+F4 in the case of mintty), except of course that the background
process might also be closed, depending on its SIGHUP handling.
Andy
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2011-05-05 4:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 4:30 Ryan Dortmans
2011-05-05 4:43 ` Andy Koppe [this message]
2011-05-05 11:38 ` Buchbinder, Barry (NIH/NIAID) [E]
2011-05-05 13:23 ` Charles Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTinhUwnY31oeQipoVaS8nRtC6=Hikw@mail.gmail.com' \
--to=andy.koppe@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).