I am experimenting with running Spring Boot apps on a remote CentOS 7 web server which has been successfully serving up apps on Apache and a stand-alone tomcat instance since day one.  However, when I ssh to the remote server and launch a Spring Boot app (which is in a jar that contains its own embedded tomcat instance), the Spring Boot web service jar runs successfully while my ssh connection is live, but then terminates after my ssh session ends.  What specific steps do I have to take to get the jar containing the Spring Boot web service to continue running after my ssh session is terminated? Here is what I typed to start the app using an ssh session from my devbox many hundreds of miles away:  [ ~]$ cd /path/to/webservice[ webservice]$ kill $(lsof -t -i:9000)kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec][ webservice]$ java -jar mywebservice.jarSince apache forwards requests for the service internally to port 9000, the service is then exposed to the outside world via an apache url somedomain.com/someurlpattern until I terminate the ssh session.
How do I get a service on a remote CentOS 7 server to persist after I log out?
centos;ssh;terminal;webserver
Running a process in background and closing ssh sessionThere are many ways to do so:1.The nohup commandYou can use the nohup command to execute commands after you exit from a shell prompt.  Example:  $ nohup java -jar mywebservice.jar > /path/to/webservice/logs/mylogfile.txt &  ## exit from shell or close the terminal ##  $ exit2.The disown bash commandAnother option is to use the disown command as follows:Example:  $ java -jar mywebservice.jar > /path/to/webservice/logs/mylogfile.txt &  [1] 10685  $ disown 10685 $ ps    PID TTY          TIME CMD    10685 pts/0    00:00:00 wget    10687 pts/0    00:00:00 bash    10708 pts/0    00:00:00 ps $ logout3.The screen commandYou can also use the screen command for this purpose.