Emergency stop, solenoid automation, looking for advise

Trying to find solution to a challenge connected to a remote emergency stop of marine diesel engines; I need to activate the stop solenoid for long enough time to stop the engine, but immediately after the engine stop, the solenoid should return to open and make it possible to restart the engine. So I guess I am looking for a sort of time relay for 12V or 24V DC. Grateful for any suggestions.