The state may be made a party to an action for the sale or partition of real property, in which case the summons and complaint shall be served upon the attorney general, who shall appear on behalf of the state.