I remember doing this with dbus but I can’t find that set-up anymore. This stackoverflow answer looks a bit more elegant: https://unix.stackexchange.com/a/128007/37570
A little script could run your command when matching the jack/headphone
events from acpi_listen
.
I’m no rocket scientist but I’d put the batteries somewhere other than in the engines.
Still, they presumably have to operate in vacuum so thermals will be a challenge. The vibration at launch must also be pretty gnarly.