receiving broadcast message on ec2

0

Hi All,

I am continuing to get below messages on my ec2 instance. Can someone please advise, what is wrong?

The system will power off at Wed

Broadcast message from root@ip-172-31-0-215.ec2.internal (Wed 2024-02-07 05:38:01 UTC):

The system will power off at Wed 2024-02-07 05:44:01 UTC!

Broadcast message from root@ip-172-31-0-215.ec2.internal (Wed 2024-02-07 05:39:01 UTC):

The system will power off at Wed 2024-02-07 05:44:01 UTC!

Broadcast message from root@ip-172-31-0-215.ec2.internal (Wed 2024-02-07 05:40:01 UTC):

The system will power off at Wed 2024-02-07 05:44:01 UTC!

Broadcast message from root@ip-172-31-0-215.ec2.internal (Wed 2024-02-07 05:41:01 UTC):

The system will power off at Wed 2024-02-07 05:44:01 UTC!

i-0821b0b17dc4619c8

I created this instance from an AMI created from a snapshot. If that matters.

Thanks!

asked 7 months ago269 views
1 Answer
0

Hi,

To prevent the immediate shutdown, you can try canceling the shutdown command (if it's scheduled with a shutdown command) by executing shutdown -c as root. However, this is a temporary fix and might not work if the shutdown is triggered by another method. To figure out why this is happening, please check below:

Since you have created this instance from a snapshot, the original instance (from which the snapshot was taken) might have had custom scripts that trigger a shutdown under certain conditions. These scripts could still be active in the new instance created from the AMI.

Check for any cron jobs that might be scheduled to shut down the system. Inspect the cron jobs for the root user and other users by checking /var/spool/cron/crontabs/ and /etc/cron.* directories.

  • Use crontab -l for the root user and other suspicious users to list cron jobs.
  • Check system-wide cron directories: /etc/cron.d/, /etc/cron.daily/, /etc/cron.hourly/, etc

Review Logs:

  • Check /var/log/syslog (or /var/log/messages on some Linux distributions) for any messages related to the shutdown.
  • Look into the logs mentioned above for cloud-init

Hope this helps.

answered 7 months ago
  • Thanks!, I cancelled the shutdown and got my work completed for now. Will follow through on troubleshooting steps you gave.

  • Found below cron entry. Took backup and removed. I suspect it is checking if cloud 9 environment is still connected to the instance or not. The EBS from which the AMI was built was from Cloud 9 env.

    [root@ip-172-31-0-215 cron.d.bkp]# cat c9-automatic-shutdown

            • root /home/ec2-user/.c9/stop-if-inactive.sh

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions