Bug 431239 - WiFi closes on lid closure ignoring settings
Summary: WiFi closes on lid closure ignoring settings
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.20.4
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-06 20:27 UTC by Sayantan Santra
Modified: 2021-02-15 16:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sayantan Santra 2021-01-06 20:27:04 UTC
WiFi closes on lid closure


STEPS TO REPRODUCE
1. Set "Do Nothing" when Laptop lid is closed, under Energy Saving
2. Close the lid of laptop

OBSERVED RESULT
WiFi turns off.

EXPECTED RESULT
Nothing should've happened.

SOFTWARE/OS VERSIONS
Manjaro Linux (5.10.2-2 kernel)
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Adding the following lines to `/etc/systemd/logind.conf` temporarily fixed the issue.
```
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
LidSwitchIgnoreInhibited=no
```
But the issue reappeared after a reboot.
Then, deleting the file `/etc/systemd/logind.conf` altogether seemed to solve it once again. But it's somehow back after a few days.
I'm not sure exactly what's happening here. Please help.
Comment 1 Kai Uwe Broulik 2021-01-06 20:37:45 UTC
That's odd. @Jan Grulich: Could NM be watching suspend? I know it turns off network devices prior to suspend but it shouldn't do that before we explicitly tell the system to suspend.

Please provide the output of systemd-inhibit --list
Comment 2 Sayantan Santra 2021-01-06 20:41:01 UTC
(In reply to Kai Uwe Broulik from comment #1)
> That's odd. @Jan Grulich: Could NM be watching suspend? I know it turns off
> network devices prior to suspend but it shouldn't do that before we
> explicitly tell the system to suspend.
> 
> Please provide the output of systemd-inhibit --list

Here it is:

WHO            UID  USER   PID  COMM            WHAT                                                                       WHY                                                        MODE 
ModemManager   0    root   513  ModemManager    sleep                                                                      ModemManager needs to reset devices                        delay
NetworkManager 0    root   459  NetworkManager  sleep                                                                      NetworkManager needs to turn off networks                  delay
UPower         0    root   857  upowerd         sleep                                                                      Pause device polling                                       delay
Discord        1000 sintan 2569 Discord         sleep                                                                      Application cleanup before suspend                         delay
PowerDevil     1000 sintan 1144 org_kde_powerde handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch KDE handles power events                                   block
Screen Locker  1000 sintan 1030 ksmserver       sleep                                                                      Ensuring that the screen gets locked before going to sleep delay

6 inhibitors listed.
Comment 3 Kai Uwe Broulik 2021-01-06 20:42:36 UTC
So there is the blocking handle-lid-switch inhibition of PowerDevil. I can't reproduce on my system. Maybe a logind bug/change as I assume your Manjaro will have a pretty recent version.
Comment 4 Sayantan Santra 2021-01-06 20:44:27 UTC
My version of powerdevil is 5.20.4-1.
Comment 5 Kai Uwe Broulik 2021-01-06 20:54:49 UTC
I mean the systemd/logind version
Comment 6 Sayantan Santra 2021-01-06 20:57:39 UTC
It's systemd 247 (247.2-1-manjaro).
Comment 7 Sayantan Santra 2021-01-08 19:06:51 UTC
Ok, so it seems like it's much weirder. I was pinging my laptop from my smartphone, and discovered that the WiFi is closing when the lid is opened, not when it's closed.
Comment 8 Sayantan Santra 2021-01-09 18:33:18 UTC
Adding to that, it's not just turning off the WiFi, it's actually toggling it i.e. it turns back on if I close and open the lid twice.
Comment 9 Sayantan Santra 2021-02-15 16:49:35 UTC
Solved [here](https://forum.manjaro.org/t/wifi-is-disconnected-when-lid-is-opened/53407/11).