A French soldier opened fire on Sunday at a man clad in a North African-style robe who was threatening military personnel with a knife in Lyon, police and the public prosecutor said.