During the period in which such examiner shall be in charge he shall prepare and make a transcript of the books and affairs of the bank, and shall generally conserve the assets of the bank. During such period the legal title to the assets of the bank shall be in the state comptroller, which title shall be generally that of a temporary receiver. The examiner in charge shall be the custodian of the affairs and assets of the bank, for and in behalf of the state comptroller, and shall work under the direction of the state comptroller. The state comptroller shall forthwith file a petition in the chancery court of the county in which the bank is situated, in a cause to be entitled, "In the matter of the custody of (naming bank) by (name of state comptroller), state comptroller." The bank shall be a party respondent to the petition, unless the board of directors, by resolution voted for by a majority thereof, shall have submitted the bank and its affairs to the custody of the state comptroller, and waived service of process on the petition, in which event the hearing on such petition may be ex parte. If no such resolution is passed the chancellor shall order a hearing on such petition at such time to be fixed by him, and shall order issuance of a summons for the bank, returnable at the time so fixed. At the hearing on the petition the chancellor shall confirm the acts of the state comptroller in taking charge of the bank unless good cause be shown for returning the bank to the management of the directors.