On Sat, 27 Feb 1999, Chris Rae wrote:
> I'm a true Linux newbie but I'm now fairly comfortable with the idea of
> processes. However, I'm interested to work out whether I can run a
> background process while logged out.
Yes.
> If I log in (via telnet), start a
> process, hit CTRL-Z and type "logout", I get the message "there are stopped
Pressing ^Z does not background a process - it simply stops it. The
process can then be restarted in the background with "bg" or in the
foreground with "fg". You can start a process in the background by
putting an & on the end of the command.
> jobs" and it won't let me log out until I've killed them. However, if I just
> disconnect the telnet session, the job keeps running but I have no way to
You shouldn't rely on that working. Some processes may get killed when
their controlling shell dies - ie when you drop the telnet connection. To
be sure of getting a process to run in the background, and keep going when
you log out, use "nohup <command> &". The output will be stored in a
file called "nohup.out".
> get it back into the foreground (I just get "fg: No such job"). It's not on
> the "ps" list but it *is* on "ps a". It's not on the "jobs" list at all.
>
The "jobs" list is the list of jobs started by your current shell. If you
log out and log back in again you are running a different shell and so
none of the jobs started from a different login will show up.
Y.
--
Mike <[EMAIL PROTECTED]>
Things will be bright in P.M. A cop will shine a light in your face.