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
gefragt vor 7 Monaten206 Aufrufe
2 Antworten
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
EXPERTE
beantwortet vor 7 Monaten
profile picture
EXPERTE
überprüft vor 7 Monaten
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
EXPERTE
beantwortet vor 7 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen