Easy, reverse bias diode across the fuel solenoid.
This WILL be your best and simplest 'engine ON' indicator by far and if you'd said it had an electric fuel solenoid we'd have all jumped on that one from the start. ![Smiley :)](https://www.eevblog.com/forum/Smileys/default/xsmiley.gif.pagespeed.ic.R8GFI-pF6f.png)
It'd be more unusual to find an old diesel that doesn't have a fuel cutoff solenoid though, so it'd be the first suggestion I'd have made.
They're there to stop runaway engines (even when the diesel from the tank is cut off it's not a guarantee the engine will stop) but aren't as necessary on newer fuel systems.
Shutting off the fuel or opening a 'dump' valve on the injection pump only helps if the runaway is due to a stuck injector rack.
2-stroke Detroit Diesels are notorious for running away, and continuing to runaway even with the fuel shut off, though it can happen with just about any poorly maintained turbo diesel, or even with a normally aspirated one with grossly excessive blowby and a high crankcase oil level. Basically if oil can get into the intake and you don't have some means of totally shutting off the air supply, you risk an uncontrolled runaway with the engine consuming its own lube oil as fuel.
In the absence of an emergency air shutoff valve, you need something that will seal the air intake effectively. If you are mildly paranoid and have ever been near a runaway diesel, you may choose to keep a pingpong bat clipped to the inside of the engine box lid. Otherwise, grab a closed cell foam cushion or the Nautical Almanac and shove it up against the intake. Don't try to use anything thin and flexible or the palm of your hand as the intake can pull a fairly high vacuum before the engine dies.