How to keep instance running after disconnecting SSH.

0

So currently I have a Lightsail instance, with a domain connected to it.

I SSH into the instance and do ./run.sh which is a script I have to start a webserver. Great, the webserver now works and the domain is also working. But as soon as I disconnect the SSH connection, the website is no longer up. If I go back into it again, I can see that the processes are not running anymore, but my instance has been active this entire time.

How do I keep it running when I'm not connected to it?

질문됨 2년 전517회 조회
1개 답변
0
수락된 답변

To fix your immediate need:

./run.sh &

That puts it in the background.

profile pictureAWS
전문가
kentrad
답변함 2년 전
  • I'm not sure why I didn't think of this... for context, my run.sh even makes use of & to run some of the commands in there. Yep, doing ./run.sh & fixes it.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠