In criminal cases, notice of the time and place at which the writ is made returnable shall be given to the district attorney, if he is within the county; in other cases like notice shall be given to any person interested in continuing the custody or restraint of the party seeking the aid of said writ.
NMS § 44-1-22