Thermodynamical definition of entropy $$S(p)=-\int p\ln p~dx$$ is defined only on equilibrium system. But why can't we use it for non-equilibrium system? Is there a well-accepted definition for it?
Just to give an account of some of the most popular approaches that I have met so far about out of equilibrium thermodynamics and corresponding generalized definitions of entropy and thermodynamic potentials.
On one end of the spectrum, on can follow a statistical inference approach to statistical mechanics in its very foundation (as it has been proposed and popularized by E.T. Jaynes in the 70's 80's). If that is the case, then the actual definition of the statistical entropy is nothing but a 'relevant' Shannon entropy accounting for our lack of knowledge on the system under study.
A quite enlightening account of this school of thought is proposed by Roger Balian in these notes.
On another end of the spectrum, one needs to realize that all these issues essentially always question the very foundations of statistical mechanics and even equilibrium statistical mechanics. Recent advances/ideas on this subject have raised in the 80's 90's that a possible strong rational basis for statistical mechanics would be the large deviation principle. In this case, the new definition of thermodynamic potentials, albeit out of equilibrium, is then believed to be the large deviation rate function. A possible account (quite technical though) about entropy within this framework can be found here.
A bit in between these ideas are ideas that rely, in one way or another, on a microstate/mesostate description (for the description level, it is really encouraged to read Balian's account given above) for which one can characterize the evolution of probability densities by a Markovian process.
Recently, strong and not very restrictive theorems on these systems have been found and hold even for out of equilibrium trajectories. These are called fluctuation theorems (initiated by Jarzinsky equality) and the most known piece of work on the subject has been proposed by Crooks in the end of the 90's and is know as Crooks' fluctuation theorem (note that is has hardly anything to do with fluctuation-dissipation theorems).
Now, still in this spirit, some people have proposed to focus on what can really happen in real systems where the systems themselves will be out of equilibrium but yet in contact with several thermostats. In such cases, provided some assumptions (based on what is called the 'detailed balance hypothesis' that ought to be satisfied at equilibrium according to this school) we can get what is called stochastic thermodynamics essentially developed by van den Broeck and quite successful in the applications he attempts to describe.
To wrap all these things up a little bit, most of these approaches (except maybe the large deviation one) acknowledge a strong relation between information and thermodynamics (look for instance at Szilard's engine, the landauer principle etc...) and, as such, will tend to define a microscopic entropy as being $- \ln p_i$ for a 'microstate' $i$ (not necessarily describing everything at the atomic level) and whose mean is the thermodynamic entropy (or an upper/lowe bound of it depending of the school) is then $S = -\sum_i p_i \ln p_i$.