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
demandé il y a 7 mois206 vues
2 réponses
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
EXPERT
répondu il y a 7 mois
profile picture
EXPERT
vérifié il y a 7 mois
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
EXPERT
répondu il y a 7 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions