Writs of mandamus shall be issued upon the order of the court or judge, which shall designate the return day, and direct the manner of service thereof, and service of the same shall be by copies of the writ, order allowing the same, and petition upon which the writ is granted.