What signal is being sent to an EC2 Instance on shut down?

EC2 uses Xen. The Xen PV driver handles the shutdown. If you were using an HVM instance, ACPI would handle the shutdown.


The command that will be run can be seen by running:

sysctl kernel.poweroff_cmd

And can be changed by running (as root):

sysctl kernel.poweroff_cmd="/usr/bin/systemctl poweroff"

Which can be made permanent on a modern systemd based system by:

cat << EOF > /etc/sysctl.d/poweroff.conf kernel.poweroff_cmd = "/usr/bin/systemctl poweroff" EOF

@Mark Wagner explained it, but the sysctl aspect wasn't clear to me!