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
feita há 7 meses206 visualizações
2 Respostas
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
ESPECIALISTA
respondido há 7 meses
profile picture
ESPECIALISTA
avaliado há 7 meses
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
ESPECIALISTA
respondido há 7 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas