Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I run a Program, and have it continue when the remote console disconnects

I want to run my Java Program on my Raspberry Pi, but it needs to continue running even if i close Putty. The Program is running on my Raspberry Pi and it is starting completely fine, but as soon as I close the console the Program stops.

I can tell it stops because after closing There wont be any Logs into the log fille (except the ones from before closing the Putty Terminal)

Currently I tried it with an sh script and this line within it:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

nohup java -jar /home/pi/Programms/PantaBot/PantaBot.jar > /var/log/logPantaBot.txt 2>&1 &

and with running the sh script with
sh startScript.sh&

The sh Script:


chmod 777 HandballDBFiller-1.0.0.jar
java -jar HandballDBFiller-1.0.0.jar > ~/Programme/HandballTippspiel/Log.txt

>Solution :

I recommend using something like screen or tmux – they both allow you to launch "persistent" terminals that you can disconnect and reconnect to later – possibly from somewhere else, without killing processes launched from such terminals.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading