How is temperature defined for interacting systems? Temperature is easy to define for closed systems. By definition, for closed systems (or systems with negligibly small interaction with the environment) temperature is (see Chandler, for example)
$$
\frac{1}{T}\equiv\left(\frac{\partial S}{\partial U}\right)_{V,N},\tag{1}
$$
where $V$ is the volume, $N$ is the number of particles, $U$ is the energy and $S$ is the entropy of the system.
One can prove that two noninteracting (or rather weakly interacting) systems at thermodynamic equilibrium have the same temperature using the principle of maximization of entropy. The principle says that when the total energy $U$, number of particles $N$ and volume $V$ are fixed for the composite system, the total entropy is maximized at equilibrium. The proof of equal temperatures is very simple. At equilibrium the entropy is at maximum, and therefore, if we transfer small amount of energy $\delta U$ from one system to another, the total change in entropy is going to be zero:
$$
\delta S=\frac{1}{T_1}\delta U_1+\frac{1}{T_2}\delta U_2=\left(-\frac{1}{T_1}+\frac{1}{T_2}\right)\delta U,
$$
which is true only for $T_1=T_2$.
My question, for interacting systems, where the total energy is expressed as
$$
U=U_1+U_2+U_{12},\tag{3}
$$
where $U_{12}=f(U_1,U_2)$ is the interaction energy, is there an accepted definition for temperature?
Note. The temperature cannot be defined as
$$
\frac{1}{T_1}=\left(\frac{\partial S_{tot}}{\partial U_1}\right)_{V,N},\tag{4}
$$
with $S_{tot}=S_1+S_2+S_{int}$, because with such definition, since $\delta U_1 +\delta U_2=-\delta U_{int}\neq 0$, the temperatures of both systems are not going to be equal at maximum entropy.
Personal idea. I am not sure if this way is a proper one, but here is my idea. We could define temperature through a tunable turn-on-off of the interaction. We could imagine that interaction between two systems is governed by a parameter $\lambda$. The value $\lambda=0$ corresponds to the no interaction case, and $\lambda=1$ corresponds to the full interaction. The interaction energy would be then a function of $\lambda$ (probably a monotonous one):
$$
U_{int}=f(U_1,U_2,\lambda).
$$
This relationship can be inverted:
$$
\lambda=F(U_1,U_2,U_{int}).\tag{5}
$$
The total entropy is a function of $U_1$, $U_2$ and $\lambda$
$$
S_{tot}=G(U_1,U_2,\lambda).
$$
Expressing $\lambda$ through $U_{int}$ from Eq. (5), we obtain that $S_{tot}$ is a function of $U_1$, $U_2$ and $U_{int}$:
$$
S_{tot}=S(U_1,U_2,U_{int}).
$$
The temperature would then be defined as
$$
\frac{1}{T_1}=\frac{\partial S}{\partial U_1}.\tag{6}
$$
With such definition, the variation of $S_{tot}$,
$$
\delta S_{tot}=\frac{1}{T_1}\delta U_1+\frac{1}{T_{2}}\delta U_2+\frac{1}{T_{int}}\delta U_{int}
$$
is zero for the fixed total energy if $T_1=T_2=T_{tot}$ (this is not the only solution though). In other words, with the above definition of temperature, the equal temperature of different parts of the system is consistent with maximum entropy at equilibrium.
Does anyone know if anyone introduced temperature for interacting systems in the literature?
 A: Your question seems to have the hidden assumption that temperature is defined as the partial derivative of entropy with respect to energy, but that is not a universal point of view in general thermodynamic applications. Here I summarize two possible approaches to your question: from an equilibrium, generalized Gibbsian viewpoint, and from the viewpoint of non-equilibrium continuum thermomechanics. References are listed at the end.
Generalized Gibbsian thermostatics
In the kind of equilibrium situation that you seem to consider, the generalized "Gibbsian" point of view is that

*

*We state which quantities define the thermodynamic state (and therefore the system), in a non-redundant way. In your case it seems you can take any three of the energies $U,U_1,U_2,U_{12}$, the remaining one being determined them, plus any other relevant thermodynamic quantities. Of course we can change the set of basic quantities to equivalent ones; this corresponds to choosing a different coordinate system on the manifold of thermodynamic states.


*We give the "fundamental equation" (Gibbs's and Weightman's terminology) that specifies how the entropy of the system depends on the thermodynamic variables. This function is usually required to be convex, but this property can be problematic or undefined in non-extensive systems, and some authors seem to drop this requirement to deal with phase transitions, for example (see eg Wightman, Landsberg & Tranah).
Then any equilibrium state is determined by maximizing the entropy function with respect to the constraints imposed on the system, expressed as functional relations between the thermodynamic variables. Of course it can happen that there's no maximum or that there are many maxima (this can also happen in standard textbook cases, see eg Callen, Appendix C p. 321). This is a general point of view that does not require extensivity or similar properties. With extensive systems additional properties of the entropy function are usually required.
From this point of view temperature becomes a somewhat secondary concept, and you could define auxiliary temperatures, if they are useful, in a "$1/T=\partial S/\partial U$" way. In your case you could define three inverse temperatures $\beta_1 = \partial S/\partial U_1$, $\beta_2 = \partial S/\partial U_2$, $\beta_{12} = \partial S/\partial U_{12}$. If your system has a constrained total energy but the energies $U_1$, $U_2$, $U_{12}$ are unconstrained, then maximization of entropy on the constrain submanifold of the state space leads to $\beta_1=\beta_2=\beta_{12}$ in the usual way. However, note that this $\mathrm{d}S\rvert_{\text{constr. submanifold}} = 0$ point might not be a maximum, and thus not an equilibrium point. See the discussion in Lynden-bell, especially at the bottom of p. 295.
There's also the tricky point to say which quantities should be kept constant in these partial derivatives: usually they are extensive quantities, but your present system is presumably non-extensive. There are studies of equilibrium non-extensive systems (typically gravitational ones), see for example Landsberg & Tranah and Lynden-Bell; but I can't find how they approached the question of the partial derivatives. And I don't know how these studies have developed in recent times.
References for this approach:

*

*Wightman: Convexity and the notion of equilibrium state in thermodynamics and statistical mechanics.


*Callen: Thermodynamics: an introduction to the physical theories of equilibrium thermostatics and irreversible thermodynamics (Wiley 1960).


*Lynden-Bell: Negative specific heat in astronomy, physics and chemistry.


*Landsberg, Tranah: Entropies need not to be concave.


*Müller: Thermodynamics.


*Müller, Müller: Fundamentals of Thermodynamics and Applications: With Historical Annotations and Many Citations from Avogadro to Zermelo (this beautiful book also studies thermodynamic systems such as droplets and rubber balloons).

Continuum thermomechanics
This is a theory of time-dependent, space-dependent, non-equilibrium thermodynamical and mechanical processes. It's a field theory: physical quantities depend on space and time. Equilibrium thermostatics is obtained in the special case where quantities are time-independent and have a uniform spatial distribution. Great introductions to this theory are Astarita's and Müller & Müller's books.
Temperature here is taken as a primitive quantity which depends on space and time, so there's no question of "defining" it in terms of other quantities. In particular, temperature is a property of matter at every point in space, not of a "subsystem". It can have discontinuities, however: for example we can have $T=T_1$ in a region of space, $T=T_2$ in an adjacent region, and $T=T_{12}$ on the surface separating the two regions. In the case of mixtures of different chemical species it would be possible to define a (spatially dependent) temperature for each of them, but such a generality is usually not pursued; see eg Samohýl & Pekař chap. 4, or Truesdell Lecture 5 and appendices to it.
The "$1/T=\partial S/\partial U$" relation is not generally valid a priori in this theory; see for example Astarita chap. 2 and Samohýl & Pekař chap. 2.
Continuum thermodynamics typically deals with situations with short-range forces, so energy is extensive. Interaction energies may be considered at surfaces (surface tension). But, again, this does not interfere with how temperature is used. See for example Astarita chap. 6.
There is a generalization of this theory that deals with energetically non-extensive systems – typically gravitational ones. Energy and entropy have a "doubly spatial" dependence in this approach. But temperature remains a quantity associated with each single spatial point. See the studies by Gurtin & Williams; unfortunately I'm not updated about recent developments of these studies.
References for this approach:

*

*Astarita: Thermodynamics: An Advanced Textbook for Chemical Engineers.


*Samohýl, Pekař: The Thermodynamics of Linear Fluids and Fluid Mixtures.


*Gurtin, Williams: On continuum thermodynamics with mutual body forces and internal radiation.


*Truesdell: Rational Thermodynamics.


*Müller: Thermodynamics.


*Müller, Müller: Fundamentals of Thermodynamics and Applications: With Historical Annotations and Many Citations from Avogadro to Zermelo (this beautiful book also studies thermodynamic systems such as droplets and rubber balloons).

Final comments
I personally prefer the second approach, because it covers more general situations. And also because in my opinion the "$1/T=\partial S/\partial U$" definition of temperature is vacuous, since it defines temperature in terms of non-directly measurable quantities. Actually we need temperature as a primitive in order to indirectly measure energy: see for example the discussion in Müller & Müller § 2.3. So the "definition" above involves some circularity.
Very insightful further references about all these questions:

*

*Bridgman: The Nature of Thermodynamics.


*Chang: Inventing Temperature: Measurement and Scientific Progress.


*Biró: Is There a Temperature?: Conceptual Challenges at High Energy, Acceleration and Complexity.
