Headteacher to spend rest of his life in prison for sodomising pupils.