Link to home
Start Free TrialLog in
Avatar of HappyEngineer
HappyEngineer

asked on

putting program into background

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.
ASKER CERTIFIED SOLUTION
Avatar of Autogard
Autogard

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Autogard
Autogard

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 &