Section 10. All officers of such institutions, before entering upon the performance of their official duties, shall take and subscribe the following oaths:—“I, A.B., do solemnly swear that I will bear true faith and allegiance to the commonwealth of Massachusetts, and will support the constitution thereof. So help me, God.” “I, A.B., do solemnly swear that I will obey the lawful orders of all my superior officers. So help me, God.” “I, A.B., do solemnly swear and affirm that I will faithfully and impartially discharge and perform all duties incumbent on me in the office to which I have been appointed according to the best of my abilities and understanding, agreeably to the requirements of the constitution, the laws of the commonwealth, and the rules provided in accordance with law for the government of the correctional institutions of the commonwealth. So help me, God.” The oath may be administered by any officer authorized by law to administer oaths, and a record thereof shall be in the possession of the principal officer of the appropriate institution.