An interesting account is brought in the beginning of הישיבה הרמה בפיורדא, חלק ב, pages 11-17, about an aborted effort to bring the famed Rav Yonason Eibeschutz to be Rav (and Rosh Yeshiva) in Feurth.
In ניסן of 5508 (1748 C.E.), elections were held for the Fuerth Rabbinate. Six candidates split one hundred and eight votes of a special committee chosen to elect a new Rav. R. Yonason Eibeschutz won the election with thirty two votes. At that time, he was serving as Rav of Metz.
However, the community of Metz didn’t want to let R. Yonason go, and they reminded him that according to the conditions he accepted upon himself when coming to Metz, he could not leave the kehillah for twelve years, unless he would pay a monetary penalty of 6,000 francs, a giant sum. They insisted upon this provision and thereby prevented R. Yonason from leaving them.
I have come across in the past other stories of Rabbonim preparing to leave kehillos and move on to new positions in days of yore, while the kehillos tried to prevent them from leaving. I was under the impression that usually the efforts to prevent such moves did not succeed. In this case, however, they did.
My recollection of the other cases where such efforts failed was along the lines of ‘the Rav left town in the middle of the night to move to his new position’. I had the impression that the efforts to keep the Rav were along the lines of physically preventing the coaches from pulling away with him. In this case however, the means to prevent the departure were financial and legal. Perhaps that is why they had more success?