This song is actually made up of two traditional songs combined by Lead Belly. They are prison work songs used for flat weeding. 'Rattler' was the name generally given to the lead search dog on a prison farm.
The name 'Old Riley' comes up in at least one other prison song. The line 'Believe I'll do like Old Riley, Old Riley walked de Brazos' appears in 'Ain't No More Cane on the Brazos.' When an inmate tried to break out of prison, he would make his way up the river bed through the shallow water, to lose his scent to the blood hounds who were in hot pursuit. This was called 'walking the water.' Apparently Old Riley was one prisoner who got away.
Lyrics and chords available from Folk Den Project.