[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Monitor switched off after resume from hibernation



On Sat 07 Jan 2017 at 08:18:51 (+0100), solitone wrote:
> On Friday, January 6, 2017 9:52:13 PM CET David Wright wrote:
> > in your terminal, you'll probably find that
> > $ echo $DISPLAY
> > will give you :0 (locally) or localhost:10.0 (if you ssh into
> > another computer). So your terminal's xset command will be
> > happy without -display as it's got $DISPLAY instead.
> > [...]
> > I'm assuming that a systemd command that suddenly pops up from nowhere
> > will not have a suitable value for $DISPLAY.
> 
> OK, I see.
> 
> I've ssh'd into the computer with the screen issue, and done some additional 
> tests. I can switch off and on the monitor from ssh with the following 
> commands ($DISPLAY is not set in shh):
> 
> $ xset -display :0 dpms force off
> $ xset -display :0 dpms force on
> 
> So, I turn the monitor off, hibernate, and resume, and I get the usual black 
> screen. The system is up and running, as I can ssh into it. From ssh I give:
> 
> $ xset -display :0 dpms force on
> 
> but nothing happen. Even if I try:
> 
> $ xset -display :0 dpms force off
> $ xset -display :0 dpms force on
> 
> nothing happens either.
> 
> So the behaviour I have from ssh is similar to what I get from a systemd 
> script. The system is apparently up and running, but I can't turn the monitor 
> on, neither from systemd, nor from ssh. Funny thing!

But you've chosen to do the difficult thing, without knowing whether
there's a bug somewhere that makes it impossible for you to succeed.
Would it not be better to get systemd to turn *on* the monitor
*before* the hibernate (and that's something you should be able to
observe happening).

One scenario might be to make systemd run a service that turns on the
monitor every few minutes. Then you can turn the monitor off with
your xset command and see if the systemd service restores it in a
minute or two.

If that experiment works, then you could go on to combine it with the
hibernation process to make sure that the monitor was on just before
hibernation started. (There might be some sort of serialisation
required to make sure the two actions occur in the right order. You
don't want a race.)

Cheers,
David.


Reply to: