Section 9. If a person whose land is attached commits waste thereon or threatens or prepares so to do or if a real action is brought to foreclose a mortgage or for possession thereunder or for the recovery of land and any waste, or act in the nature of waste, on the land has been committed or threatened by the tenant or any one who claims under him or acts by his permission, the court in which the action is pending shall, upon motion of the plaintiff or demandant, have jurisdiction in equity to enjoin such waste or act. In such case the court may require the plaintiff or demandant to give bond in such sum as it orders to the adverse party, with sufficient sureties, conditioned, if the injunction is dissolved, to pay all damages arising from the issuing thereof.