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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ