Solved

putting program into background

Posted on 2006-11-27
2
248 Views
Last Modified: 2012-05-05
There's an app that I start that I want to keep running after I log out. I do this by running something like:
  ./appscript.sh &
Then, I log out and it works fine.

However, I've found that if I run the above command and then don't log out that it'll work only until my session disconnects due to inactivity. At that point it hangs or dies or something.

It only sticks around after I disconnect if I purposely disconnect by typing exit.

This is annoying because in order to make sure it sticks around I always run it then log out then log back in so that I can check the logs to see how it's doing.

I want to know how to avoid having to log out in order to make sure it sticks around.
0
Comment
Question by:HappyEngineer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
Autogard earned 500 total points
ID: 18023322
Have you tried using "nohup"?  Type "man nohup" to see how it works.

Basically:

nohup ./appscript.sh &
0
 
LVL 8

Expert Comment

by:Autogard
ID: 18023356
One more thing... this will redirect output to a default file.  If you don't want that file created, you can do a:

nohup ./appscript.sh > /dev/null &

or you can specify another file to send it to:

nohup ./appscript.sh > somefile.log &
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question