In each city there shall be a department of public safety, which shall be administered by a director of public safety. The director shall be appointed by the mayor and need not be a resident of the city at the time of his appointment but shall become a resident thereof within six months after his appointment unless such residence requirement is waived by ordinance.