Upon the filing of the petition, said court shall fix a date for hearing said petition, and the attorney for the petitioner shall prepare and issue a summons, directed to the defendants, notifying them of the date fixed by the court for the hearing. Jurisdiction of said defendants shall be obtained by causing the summons to be served on the defendants in like manner as is provided by the laws of this state for the service of summons in civil actions, except as otherwise provided in this section. The date for the hearing of the petition shall not be less than ten days after the date of the service of the summons. In case any defendant does not reside in said city or city and county or is a foreign corporation or in case the attorney for the petitioner files an affidavit that he has endeavored to find such person in such city or city and county, for the purpose of causing the person to be served, and that after reasonable effort he has been unable to find said person in said city or city and county, the petitioner may cause the summons to be published for three consecutive times in any daily or weekly newspaper published in said city or city and county. The date for the hearing of said petition shall not be less than ten days after the date of the last publication of said summons.