  We discuss the effects of magnetic impurities on d-wave superconductors. We
calculate the electron mediated RKKY interaction between the impurity spins in
a d-wave superconductor and find that it decays as $r^{-3}$ at large distances.
We argue that this interaction leads to the formation of a spin glass at low
temperature $T \ll T_c$. It was previously shown that a local complex $\Delta^1
\sim d_{xy}$ order parameter is induced around each impurity spin. We consider
the pair tunneling resulting in the Josephson interaction between different
patches of induced $d_{xy}$ order parameter. Due to the local coupling between
impurity spins and the superconducting order parameter the Josephson coupling
favors a ferromagnetic phase at low temperatures. The competition between the
Josephson coupling and the RKKY interaction gives rise to an interesting phase
diagram. At low impurity concentrations we find an unusual supercondcting phase
glass, where the impurity spins $S^z$ and $d_{xy}$ component are disordered and
yet the product of these two develops a true long range order $<S^z \Delta^1>$.
This phase has no analog in purely magnetic spin glasses and arises as a result
of the direct coupling of the impurity spin to the phase of $\Delta^1$. At high
impurity concentrations it is possible that a ferromagnetic phase will form.
