The photos below show one version of a pre-1945 railroad signal. Other models exist.
These were used on tracks when personnel worked close to, or on the railroad tracks.
When the train-driver ran over these, a loud explosion was heard which alarmed the driver to slow down and stop.

The thin zinc body was filled with a pyrotechnical mixture. The brass strap allowed the alarm to be fitted to the track.

Click the images to enlarge.

Photos below © Jarda Mattas

I got these very nice photos below from Germany.
This is a 1930's wooden case that originally held the signals shown above.

Photos © Frithjof Hoffmann.


The two photos below show the storage can for other "Knallkapseln", used by the West-German RailRoad Company (DB) in the 1960's.

Photos © Frithjof Hoffmann.