 There is a flame detection device that will shut down the fuel valve if the flame fails or goes out 

With the pilot still burning, the main burner valves are opened and the main flame is lit.The flame detection device here will also shut-down or close all the fuel valves if the flame is extinguished.The pilot valve is shut and the main burner is left on and burning.