How do I keep a process, specifically one spawned via the sbt
command, alive after exiting my ssh
session? The following related questions [1], [2], [3] and [4] have been informative but have not led to a definitive solution in my particular case. A brief background: I have three servers representing nodes that comprise a cluster and each node has the the same program running on it to distribute computationally intensive tasks. This process is intended to always run while the machines are up, i.e. each server is dedicate solely to this project. Each node has the following (I will update this with the correct information when I get a chance to log back in):
Ubuntu 12.04.2 LTS
JVM X.X.X (is JDK 1.7 update 24+)
Scala X.X.X
sbt X.X.X
I access each node through my university's network via ssh
. I have tried tmux
and detaching a session, but this only persists the process as long as my own laptop does not restart. I take the following steps to begin the program on each node:
- Log into each node via
ssh user@host -p port
- Navigate to the appropriate directory and start my program with
sbt
* - Issue the
run
command in thesbt
console
* The actual command is sbt -Dgeotrellis cluster_seed_ip=xxx.xxx.xxx.xxx
Is disown
or nohup
the most appropriate approach to take? Given an answer for one or the other, what specific and syntactically correct command do I need to issue (from the sbt
console if using the disown
approach) so that the sbt
process disassociates from my user account and will continue running after I exit the ssh
session?