Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-02-2004, 03:22 PM   #1
LQ Newbie
Registered: Apr 2004
Location: Hornell, NY
Posts: 2

Rep: Reputation: 0
trouble with background process and logging out successfully

I am using Simon Tatham's PuTTY program to ssh from a Windows machine
to a Linux machine, which is using a version of Red Hat that is currently unknown to me.

I am running into a problem with background processes and logging out:

I am putting a C program's run into the background with no problem (i'm using the tcsh shell), but when i go to log out (using exit), I lose the
command line, but the session doesn't terminate. I can only terminate it
if i actually close PuTTY. When i ssh back to the Linux machine at a later
point, the process is gone (as if it were killed). I'm assuming this is due to
the improper closing of the session, but I don't know what's being done improperly.

I was told maybe a special compilation of the C program was needed, but
I couldn't find an option in the man pages for gcc that said anything
about background processes.

I'm unsure if this is a C, Linux, PuTTY, tcsh problem or some combo therein......

Thank you for your attention

Old 04-02-2004, 03:32 PM   #2
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
if this is what I think it is your starting a program with the & to drop it to the backgorund then logging out and that program is killed right?

That is standard, what you can do is run screen and you won't have to worry about it.

this is how you do it.
screen --A -m -d -S [whatever you want to call the screen here] [path to application here]
once you run that you can do
screen -r [screen name]
that will show you that screen and you can interact with the program. To drop out of the screen press "CTRL + a" and then "d" and you'll drop back to a normal terminal.

Once a program is running in screen you can logout and it'll keep running.

Hope that helps.
Old 04-04-2004, 04:02 PM   #3
LQ Newbie
Registered: Apr 2004
Location: Hornell, NY
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up re: trouble with bp and logging out

You were exactly right in your assessment of the situation, Khabi.

Thank you profusely for the prompt reply. I have undertaken your suggestion and that has solved my hangup (as in I've logged out and
back in and the applications are still running). Kudos to you Khabi!!

[Note: i got an "error" when i used the --A option in the e-mail, but
had success when i changed it to -A, which was in the list of options.
Was this OK?]

As a quick follow up (so that I and possibly others can learn from this):

the original reason for this was: i have an application which will need 24
hrs to complete, and it was not possible for me to remain logged in that
long remotely because i only have (gasp!) dial-up service. It was suggested to me to run in the background. Is the purpose of running
in the background only to free up the command line, and doesn't solve
the problem needing to log out? Just trying to understand the
background (and my new found friend screen!) a little better......thanks
again Khabi, and thanks Linux community in general!

Old 04-05-2004, 01:03 AM   #4
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
Yes, it was just supposed to be -A. Typo
But yes, its just for freeing up the console so you can do other things.

Glad I could help


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging From Background shadypalm88 Programming 6 01-20-2015 03:14 PM
really background a process Henster Linux - Newbie 1 07-01-2005 06:29 AM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 01:27 AM
Background process h8r Linux - Newbie 5 01-13-2003 05:21 PM
background process gurra Programming 9 09-30-2001 02:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration