When I start the tractor:
I turn the key and the hour meter comes on
it cranks
it starts
the hour meter goes off
the engine shuts off

I did this repeatedly until it ran long enough to drive from my barn to my garage, then it shut off again.
I blew all the dust off the circuitry board to no avail.

I repeated again, starting and re-starting until I noticed the hour meter turning off when the engine was revving up.
So I start it and turn the key to off and then on again while the engine was trying to rev up. Walla! I think.

If I start the tractor and while it is revving up I turn off the key and then turn it back to on then everything works.
Or it could be it decided to run for a long time while I put the tractor in the garage and on my lift.

What is going on? Seems like a safety relay or something.

it has the Kohler, single cylinder engine. year of mfg is 2002