I am searching for the name of a novel I read as a teenager, back in the 1970;s or 1980's. It was about a generation ship which had two captains, one for the voyage out and one for the return, but the first captain wouldn't give up command and was using the second captain as a way to ensure that all of the crew members remained human. So he would have the second captain killed over and over, so that each time it would be like he just woke up from cryo. The second captain has no memory of who he is, but slowly starts to unravel the mystery.
Any chance this would be The Dark Beyond the Stars by Frank M. Robinson? The Wikipedia page indicates a match on some important details:
The ship has slowly shrunk from cannibalizing sealed off sections for parts and breaking apart from centuries of wear; meanwhile, the crew has dwindled from generations of selective breeding. The Captain wants to take the Astron to a section of the galaxy where stars are more numerous and older where planets are more likely to harbor life, but to do so they would have to cross the empty space between spiral arms they call "the Dark". Most members of the crew know that they will not survive the journey since it would take several centuries to cross and the ship would not make it with its current rate of attrition of their closed ecological system. But Captain Kusaka, who is immortal and obsessed with exploration, does not heed to the warnings and will do whatever it takes to complete the mission. As a result, the crew secretly try to plan a mutiny to seize control of the ship and return to Earth, the only place they know that harbors life.
Sparrow refuses to join the mutiny with his friends against Kusaka, but is torn since he knows they won't survive the trip and that chances of finding life are almost nonexistent, thus making the mission futile but the Captain won't accept it. Things change when Sparrow slowly discovers that he is also immortal like the Captain, and that he has lived previous "lives" on the ship as the same man but with different names and his memories of every previous identity are erased every generation by orders of the Captain. He learns that he originally volunteered for the role to be the mirror for every crew to "remember what its like to be human"; since they've been isolated from the rest of humanity over the centuries the crew has formed their own collective-mind culture that's overly benign and incapable of harm since they regard life as the most precious thing in existence (also makes them reluctant to mutiny). Sparrow also learns that he was the first mutineer and Kusaka erased his memories to keep the crew in line and Sparrow from seizing control of the ship since the Astron's central computer only responds to the minds of the immortal crew members, and should they be removed the ship would not function and would drift through space forever.
This book has been previously asked about and IDed by user14111 in this question:
though the OP of that question has not yet accepted the answer.