Running python in command line without keeping the EC2 instance connect session open

0

I recently took an image for Ubuntu Linux server and it provided me access to command line via EC2 instance connect. I was able to start the python program that i wrote and it runs normally as expected. I want this to run without any interruption 24 X 7. The program is designed to run continuously.

When i close the browser session and reconnect again via EC2 instance connect, i do not see the python program running when i checked the ps aux command. I thought of running the python program as service but i am not able to do it due to restrictions with the permission in /var/run/.

Please provide the best option to address this.

gefragt vor 6 Monaten201 Aufrufe
1 Antwort
1
Akzeptierte Antwort

Linux's screen command is what you want. It allows you to run something in a shell, then you can detach from that session and it keeps running in the background.

Then to check its progress you reattach to the screen session, and can detach from that again later. And so on.

https://linuxize.com/post/how-to-use-linux-screen/

profile picture
EXPERTE
Steve_M
beantwortet vor 6 Monaten
profile picture
EXPERTE
überprüft vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen