I would like to control power of a Raspberry Pi 4 using another Raspberry Pi 4. Each Raspberry Pi is powered by its own official Raspberry power supply, to make sure each one gets enough power.
It should be possible to force a shutdown and power up the slave-Pi4 afterwards again. This has to work even when the slave-Pi OS is frozen.
Reason is: I'm building a Continuous Integration pipeline, where the master prepares an OS image for the slave-Pi to boot via network/PXE. In case the provided image is broken and fails to boot, the master should still be able to reset the slave to try a new image.
Is it possible to do this using GPIO pins? Which pins should be connected?