A cargo ship carrying tons of coal sank off the coast of Somalia, and a rescue mission was under way to save the crew, said officials on Thursday.