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.

feita há 6 meses201 visualizações
1 Resposta
1
Resposta aceita

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
ESPECIALISTA
Steve_M
respondido há 6 meses
profile picture
ESPECIALISTA
avaliado há 6 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas