EC2 instance getting shutdown instantly due to a system service I created which runs "sudo shutdown -h now" command.

0

I had created a system service (also enabled it to run on every reboot) to run our application and then shutdown once application was closed, but while debugging i had commented the line which runs our application so the system service will shutdown the instance as soon as the instance starts. I'm not able to disable the the service as SSH connection is also not possible due to instant shutting down of instance.

Is there any way I can remove the file start_app.sh which is used by my service without starting the instance??

mahadev
已提問 7 個月前檢視次數 206 次
2 個答案
1

Hello.

What about deleting files using user data?
By using user data, I thought it would be a good idea to have the script set in the use data delete "start_app.sh" the next time it starts.
https://repost.aws/knowledge-center/execute-user-data-ec2

profile picture
專家
已回答 7 個月前
profile picture
專家
已審閱 7 個月前
0

You could create a new instance; then mount the EBS volume from the first instance on the new instance then edit the script or make other changes as necessary. That way, you're not relying on booting the instance which will quickly shut down again.

profile pictureAWS
專家
已回答 7 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南