The fault may be a faulty sensor as this maintains the pilot gas valve, but first make sure that the pilot jets are clean and the flame is sufficient and playing on the thermocouple sensor. If the jets are dirty then the flame may be only partially heating the thermocouple.
Jeff, July 2008