I have this problem with my older road bike...This bike has a rack that attaches to seat post and attaching it to the saddle post does not work because the wedgie is in the way...Tried attaching it to the straps in the pack but that is too unstable...
With this bike I wear ankle reflecterized ankle straps and a UFO light about another ankle...
The only thing I can figure is to attach some kind of clamp about the rack tubing....There once was a hole in the rack for a light to be attached to, but with vibration it apparently became stripped.