Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot App not working after ssh logout

So I'm deploying my Spring Boot application on an Ubuntu LTS Server. It is built with maven and running with embedded Tomcat.

I'm still new to the deployment process, what I did was:

  1. Log into server via ssh
  2. use scp to upload my_application.zip
  3. unzip it in ssh
  4. java -jar my_application.jar

Now all of that works perfectly fine and I've been using it like that for quiet some time. Now I have to make the Application to stay online and available after logging out of the shell.

I have read some documentation about running processes in background on Linux and I've tried it with nohup java -jar myApplication.jar &, with the screen command and with bg. All of them worked fine while I'm logged into the ssh.

Here comes my problem:

As soon as I end the ssh session the Web App is still available (so the process clearly didn't stop) but it just looks & behaves really weird. CSS is not applied, JS does not work etc.

My guess would be that some paths or file system accesses are messed up, but I have no idea at all how that could origin from the ssh session.

(When I log back into ssh everything is working fine again)

Would be great if someone has a clue here

like image 764
Claudio Brasser Avatar asked Nov 20 '25 00:11

Claudio Brasser


1 Answers

If your server has encrypted home directory, it will get re-encrypted once you log out and therefore your script will stop working. It does not have a lot of sense to have encrypted homes on servers so you can disable it.

Or just run the script from different directory and avoid working with files under home directory.

like image 159
Jakuje Avatar answered Nov 21 '25 13:11

Jakuje



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!