Julie Bosman / New York Times News Service

When Sammy Hagar appeared at Left Bank Books in St. Louis in March to autograph copies of his memoir, it was not a typical book signing.

Hagar, the former Van Halen lead singer, started sipping tequila as soon as the event began. Police officers were hired to provide security. And nervous bookstore employees pleaded with eager female fans not to lift their shirts in front of Hagar when they reached the signing table.

“Nobody did,” said Kris Kleindienst, the relieved bookstore owner.

Such are the perils of working with the rock ’n’ roll legends who have lined up to write their life stories lately, a group that includes Keith Richards, Ozzy Osbourne, Patti Smith, Pete Townshend, Bob Mould and Gregg Allman.

In a squirrely market for books, the rock memoir has taken off, spurring publishers to pursue more book deals with musicians willing to tell their stories.

“There is an unusual number,” said Ed Victor, the literary agent who represents Richards, Eric Clapton and Townshend. “And that’s because there’s been some very successful ones and people want to copycat.”

Richards’s book, “Life,” which sold for more than $7 million, received raves from critics and stayed on the New York Times’ hardcover best-seller list for 22 weeks. A memoir by Steven Tyler, the Aerosmith frontman, was such an early hit that his publisher, Ecco, an imprint of HarperCollins, went back to press six times before the book was published in May, based on the strength of pre-orders from bookstores and online retailers.

Smith won a National Book Award in nonfiction last year for “Just Kids,” a memoir of her relationship with Robert Mapplethorpe and her bohemian adventures in New York in the 1960s and ’70s.

“It appears that the entire Rock and Roll Hall of Fame is now sitting in front of the computer,” said David Hirshey, the HarperCollins editor who just bought Townshend’s memoir.

Even Hagar landed in the No. 1 spot on the best-seller list earlier this year with his memoir, “Red,” which went on to sell 61,000 copies in hardcover, according to Nielsen BookScan, which typically tracks 75 percent of retail printed sales and does not track e-book sales.

“I was surprised, but nobody was more surprised than Sammy,” said Lisa Sharkey, the editor who acquired “Red” for It Books, an imprint of HarperCollins. “He almost started to cry. He had to step outside. He was basically jumping up and down.”

Twilight musings

Publishers and agents said the unusually large pack of rock memoirs could have materialized not only thanks to a dose of baby-boomer nostalgia but also because so many musicians are reaching the twilight of their careers, long after they have written their most famous songs and collected their most decadent tales of sex and drug use.

“There is a generation of titans who are now looking back and realizing that their tales have yet to be told,” said Michael Pietsch, the publisher of Little, Brown, part of the Hachette Book Group.

Perhaps more than in other celebrity memoirs, musicians tend to tell stories with built-in tension and drama, said Stacy Creamer, the publisher of Touchstone, which will release a book in October by Duff McKagan, the former Guns N’ Roses bassist.

“With the music people, there’s always going to be a tough climb up,” Creamer said. “There’s temptations or stuff to get through once you’re really successful. Then the band falls apart. The whole arc of the story is going to be riveting.”

The critical success last year of Richards’ book, in particular, may have inspired the deals that came afterward, said Jamie Raab, the publisher of Grand Central Publishing. “It has whetted people in publishing’s appetite for these books, thinking there is an audience for them,” she said. “And on the other side, there are other musicians who realize that they can be very successful and they can be done at a very high level. There’s more of an incentive to do something if you feel it can be done well.”

There are so many rock memoirs that some editors wondered if the category is getting overcrowded. Next year will see the publication of books by Billy Idol and Allman, among others. “In publishing, if something works, people keep doing it until it doesn’t work anymore,” Halpern said. “I have a feeling we’re getting close to that. I think the reading public is going to get a little worn out.” (The genre is not limited to grown-ups: Macmillan Children’s Publishing Group said on Thursday that in 2013 it would publish a picture-book biography of Robbie Robertson, written by his son, Sebastian.)

But many performers have yet to be persuaded to write their life stories, including Elton John, Paul McCartney and Bruce Springsteen, who according to a persistent rumor has been writing his memoir for years.

“My white whale is David Bowie,” said Creamer of Touchstone, part of Simon&Schuster. “I will retire if I can get David Bowie.”