Ubuntu 16.04.2 w/lenovo w540 laptop in dock immediately sleeps after login

Asked by brian mullan

I started having a problem with my normally working system.

I have a lenovo w540 laptop, i7, 32G ram, 1TB SSD and a Lenovo Ultra Dock.

I used to be able to just boot up with the laptop docked & login and start working.

Sometime within the past couple weeks I started having a problem.
After login password entry within seconds the laptop would go to sleep.
Any attempt to restart, the laptop would go right back to sleep as soon as I clicked on anything.

Eventually I found that if I left the LID open ... this didn't happen.

To eliminate any possible hw failure I did the following:
a) dock failure - so I upgraded the Lenovo Dock firmware
b) BIOS prob - so I upgraded the Lenovo W540 BIOS
c) DisplayPort cable going bad - replaced it

Eventually I found what appears to be a fix for this.

I edited: /etc/systemd/logind.conf

and uncommented then changed the following 2 lines to "ignore"

#HandleLidSwitch=suspend
HandleLidSwitch=ignore
#HandleLidSwitchDocked=ignore
HandleLidSwitchDocked=ignore

This fixed my ongoing problem.

I tried to file a BUG but was NOT sure what to file this against. It appears to be that something changed in the defaults of systemd's handling of the above 2 entries in Ubuntu 16.04 lately.

I have verified this and by restoring those 2 entries & rebooting the problem comes back.

So I am hoping some Developer will know what to do with this information as I have to believe there are others being hit by this and not understanding whats going on.

Brian

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
brian mullan (bmullan) said :
#1

Thinking about it after posting this message I will try to just use only the "HandleLidSwitchDocked=ignore" as this is really the only time when I'd want the laptop NOT to sleep when the lid is closed.

If it is UN-docked then the default of suspending when the LID closes would make sense.

In either case this probably should be a bug that gets the default condition right for a docked laptop when the lid gets closed.

Revision history for this message
brian mullan (bmullan) said :
#2

Well I tested using ONLY -
"HandleLidSwitchDocked=ignore"

and leaving
"HandleLidSwitch=ignore" commented out and the failure is back.. the laptop
goes to sleep as soon as I click on anything after logging in.

So I guess my original statement stands. BOTH of those lines need to be set to IGNORE
for the system to work properly when Docked WITH the LID closed.

brian

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you use Zesty in live CD / USB desktop, is it OK?
You may want to try the latest kernel to see if it helps with compatibility.

Revision history for this message
brian mullan (bmullan) said :
#4

I just created a bootable usb with 16.10 on it.

booted from the USB

booted normally and got the screen with 'try ubuntu" or "install ubuntu"

I clicked "try ubuntu"... as soon as I did that the laptop goes to sleep (suspends).

However, unlike 16.04 i can press the power button to unsuspend it and after doing that everything operates normally.

On 16.04, if I hit the power button (w the lid closed) to unsuspend... it unsuspends but the first click I do on the screen it goes back into to suspend mode

The only workaround on 16.04 that I've found are:
a) leave the laptop lid open (which is nuts if its docked & I have an external monitor).
b) change those 2 settings in /etc/systemd/logind/conf to "ignore"
    HandleLidSwitch=ignore
    HandleLidSwitchDocked=ignore

Revision history for this message
brian mullan (bmullan) said :
#5

Actually ... this very same systemd .conf file just solved a MINT guy's
problem. his was a bit different in that when he closed his Laptop LID his
MINT machine would not suspend/hybernate but would spin his Fan
continuously until his battery went dead.

See this thread... NOTE he is on Debian (upstream frm Ubuntu as you know)

https://www.reddit.com/r/linuxquestions/comments/5xm5ci/sometimes_when_i_close_my_lid_my_laptop_will_not/?st=izyee6jk&sh=f5d721db

NOTE: the MINT guy was NOT on a docking station attached to an external
Monitor like I was. He was just a traditional laptop user.

Do you Dev's think this might all be related to the high battery drain on
laptops by Debian/Ubuntu etc based machines that have been reported over
the past year or so ???

Just thought I'd ask. Because if Ubuntu/Debian/whatever has been ignoring
laptop LID closures or reacting inappropriately then I could see that
draining battery like happened to the MINT guy.

FYI... his problem was solved by changing /etc/systemd/

Also, should "my case" be filed as a BUG and if so against what
Package/system ?

Brian

On Sun, Mar 5, 2017 at 2:33 PM, brian mullan <
<email address hidden>> wrote:

> Your question #524949 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/524949
>
> brian mullan posted a new comment:
> I just created a bootable usb with 16.10 on it.
>
> booted from the USB
>
> booted normally and got the screen with 'try ubuntu" or "install ubuntu"
>
> I clicked "try ubuntu"... as soon as I did that the laptop goes to sleep
> (suspends).
>
> However, unlike 16.04 i can press the power button to unsuspend it and
> after doing that everything operates normally.
>
> On 16.04, if I hit the power button (w the lid closed) to unsuspend...
> it unsuspends but the first click I do on the screen it goes back into
> to suspend mode
>
> The only workaround on 16.04 that I've found are:
> a) leave the laptop lid open (which is nuts if its docked & I have an
> external monitor).
> b) change those 2 settings in /etc/systemd/logind/conf to "ignore"
> HandleLidSwitch=ignore
> HandleLidSwitchDocked=ignore
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

I'd say Xorg

Can you help with this problem?

Provide an answer of your own, or ask brian mullan for more information if necessary.

To post a message you must log in.