Section 16A. Upon a civil action brought in the name of the commonwealth by the attorney general, or district attorney for the district, or the chief of police, or the board or officer having control of the police of the state, or of a town or city, or by not less than ten legal voters of a town or city, in their own names, stating that a building, place or tenement situated therein is being used for the illegal keeping, sale or manufacture of alcoholic beverages, as defined in section one of chapter one hundred and thirty-eight or houses a premises which is licensed under section twelve of said chapter one hundred and thirty-eight and on or in such premises alcoholic beverages are habitually served to persons who are intoxicated or alcoholic beverages are served to persons whom the operators of said premises know or have reason to know will operate a motor vehicle under the influence of intoxicating liquor in violation of subdivision (1) of section twenty-four of chapter ninety or is used for the illegal keeping, sale or manufacture of controlled substances, as defined in section one of chapter ninety-four C, the superior court may abate the same as a common nuisance and may enjoin the person conducting or maintaining the same, and the owner, lessee or agent of the building, place or tenement in or upon which said nuisance exists, and their grantees or assignees, from directly or indirectly maintaining or permitting such nuisance, and, subject to the provisions hereinafter contained, may order the effectual closing of such building, place or tenement, and the prohibition of its use for any purpose for a period of not less than one month nor more than one year thereafter; provided, however, that if said building, place or tenement contains other occupied dwelling units, the occupants of which were not involved in said nuisance, no such closing of other occupied dwelling units shall take place so as to adversely affect such occupants. Proceedings under this section shall be in the manner provided in sections seven to twelve, inclusive, except that the provisions of section nine regulating the closing of a building, place or tenement and the prohibition of its use for any purpose because of the maintenance of such nuisance shall not apply and in lieu thereof the court may include in its judgement an order for such closing and prohibition, if it appears that prior thereto and within the preceding three years there shall have been three convictions for the illegal sale, or keeping, or manufacture of alcoholic beverages as so defined, or two convictions in the preceding five years for the illegal sale or keeping or manufacture of a controlled substance as so defined in or upon the premises on which such building, place or tenement is situated, or three judgements for permanent injunction enjoining the maintenance of such nuisance. A judgement for a permanent injunction or abatement shall include an order that a copy thereof shall be posted in a conspicuous place on the building, place or tenement affected thereby, on or near one or more of its principal entrances and that the removal, defacement, erasure or mutilation of a copy so posted shall be contempt of court. In addition to such posting, a copy of the judgement shall be delivered in hand to the person in charge of such building, place or tenement if he may be found upon the premises or to anyone residing therein, and if the judgement includes an order for the effectual closing of said building, place or tenement and the prohibition of its use for any purpose for a period of not less than one month nor more than one year, a copy shall be filed forthwith for record in the registry of deeds for the county and registry district within which such building, place or tenement is situated. The provisions of section thirteen shall apply to all persons found in or upon premises used for the illegal sale, or keeping, or manufacture of alcoholic beverages or controlled substances, as so defined.