Solved

putting program into background

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
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 …
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now