One of the things that can be done to stop a diesel which is running on after the key is turned off is to loosen and remove the primary fuel filter. It is usually a spin-on filter on the engine--somewhere near the injectors. Removing the filter allows air into the fuel line and will stop the engine before it consumes all of the fuel in the tank.
Starting an engine which has been fuel starved requires bleeding the air out of the fuel lines at the injectors. Turn the key on to cause the fuel pump to run, and use a line wrench at each injector to bleed the air.