Solved

putting program into background

Posted on 2006-11-27
2
250 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

621 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