Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2004 12:27:31 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Robert Storey <y2kbug@ms25.hinet.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: log off with process running
Message-ID:  <20040326122731.GC93415@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20040326092248.4845573e.y2kbug@ms25.hinet.net>
References:  <20040326092248.4845573e.y2kbug@ms25.hinet.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--RIYY1s2vRbPFwWeW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 26, 2004 at 09:22:48AM +0100, Robert Storey wrote:
> OK, that download might run for hours. I don't want to stay connected for=
 hours,
> I want to log off and hang up the modem. The question is, how to do so? W=
ith the
> above process running, I can't even get back to the command line to type =
"exit"
> (and wouldn't typing "exit" kill any process I'm running?). Ditto if I hit
> ctrl-c. I suppose I could just hang up the modem, but that's not elegant.

Others have posted a number of useful solutions to this sort of
problem.  However all of those solutions require a deal of
forethought.

Suppose you've got a long running process hogging the foreground of
your shell, and you want to background it.  All you need do is hit
Ctrl-Z to stop the process and then 'bg' to restart it in background.
If you've got a lot of jobs running concurrently in a shell you might
need to tell the shell which one to background, which you do by: 'bg
%n' -- 'n' is the job number, as returned by the 'jobs' shell built-in
command.  Putting the process into the background like that is usually
enough to protect the process from being killed when you log out,
although different shells can behave differently in that respect.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--RIYY1s2vRbPFwWeW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAZCGzdtESqEQa7a0RArbXAJ9CeqFMOlwnZ4pTPGEsiJ35gpRKAQCcCjGH
exWMn+9e6QMkJUfid8jIAAE=
=CJIx
-----END PGP SIGNATURE-----

--RIYY1s2vRbPFwWeW--



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