Section 2. Licensing authorities may grant licenses to persons to be innholders or common victuallers. Such license shall not be issued or be valid until it has been signed by a majority of the aldermen in cities where the license is to be granted by the aldermen, by a majority of the licensing board in other cities or by the selectmen in towns. An alderman, any member of the licensing board or a selectman may refuse to sign a license for a person who, in his opinion, has not complied with this chapter. This section shall not require the licensing authorities to grant either of said licenses if, in their opinion, the public good does not require it. Unless otherwise established in a town by town meeting action and in a city by city council action, and in a town with no town meeting by town council action, by adoption of appropriate by-laws and ordinances to set such fees, a fee of not more than twenty-five dollars may be charged for either of said licenses, but in no event shall any such fee be greater than $100. The licenses shall be recorded in the office of the licensing authorities. An alderman, member of a licensing board or selectman who signs a license granted contrary to this chapter shall be punished by a fine of not more than fifty dollars.