Ubuntu Laptop disable going to sleep when lid closed

lightdm과 같은 윈도 매니저 쓸때는 전원 컨트롤이 잘 되었으나 콘솔모드에서 뚜껑을 덮으면 연결된 네트워크가 끊어지는 문제 발생

추적결과 대충 아래의 메시지 발견

systemd-logind[12221]: Lid closed.
systemd-logind[12221]: Suspending...
NetworkManager[878]: <info>  [1572522339.0077] manager: sleep: sleep requested (sleeping: no  enabled: yes)
NetworkManager[878]: <info>  [1572522339.0078] device (wlp4s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
NetworkManager[878]: <info>  [1572522339.0084] manager: NetworkManager state is now ASLEEP
NetworkManager[878]: <info>  [1572522339.0088] device (enp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
dbus-daemon[835]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1
NetworkManager[878]: <info>  [1572522339.0280] device (enp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
vmnet-natd[11087]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00011043
vmnetBridge[11065]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00011043
systemd[1]: Starting Network Manager Script Dispatcher Service...
dbus-daemon[835]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
systemd[1]: Started Network Manager Script Dispatcher Service.
nm-dispatcher[23024]: req:1 'connectivity-change': new request (1 scripts)
nm-dispatcher[23024]: req:1 'connectivity-change': start running ordered scripts...
NetworkManager[878]: <info>  [1572522339.0930] dhcp4 (enp2s0): canceled DHCP transaction, DHCP client pid 22932
NetworkManager[878]: <info>  [1572522339.0930] dhcp4 (enp2s0): state changed bound -> done
vmnet-natd[11087]: RTM_DELROUTE: index:2
vmnetBridge[11065]: RTM_DELROUTE: index:2
vmnet-natd[11087]: RTM_DELADDR: index:2, addr:192.168.1.32
NetworkManager[878]: <warn>  [1572522339.0959] dns-mgr: update-dns: plugin unbound update failed
NetworkManager[878]: <info>  [1572522339.1035] device (enp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
nm-dispatcher[23024]: req:2 'down' [enp2s0]: new request (1 scripts)
nm-dispatcher[23024]: req:2 'down' [enp2s0]: start running ordered scripts...
kernel: r8169 0000:02:00.0 enp2s0: Link is Down
vmnetBridge[11065]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00001002
vmnet-natd[11087]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00001002
vmnetBridge[11065]: Removing interface enp2s0 index:2
vmnetBridge[11065]: Stopped bridge enp2s0 to virtual network 0.
kernel: userif-3: sent link down event.
kernel: userif-3: sent link up event.

“/etc/systemd/logind.conf” 파일의

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

부분 수정 후 재부팅

systemd-logind[968]: Lid closed.
systemd-logind[968]: Lid opened.
systemd-logind[968]: Lid closed.

반응없음을 확인

Leave a Reply

Your email address will not be published. Required fields are marked *