Thinkpad X230T won't suspend under kernel 419rc4, 4.18, 4.17, 4.14, 4.9

I think that I've now diagnosed the problem, and could now use some help on the fix!

Some clues come from Suspend issue with latest Manjaro 4.17.0-1

When I try this myself, I get ...

 Why: Application cleanup before suspend
Mode: delay

 Who: Screen Locker (UID 1000/daviding, PID 895/ksmserver)
What: sleep
 Why: Ensuring that the screen gets locked before going to sleep
Mode: delay

 Who: skypeforlinux (UID 1000/daviding, PID 968/skypeforlinux)
What: shutdown
 Why: Ensure a clean shutdown
Mode: delay

 Who: NetworkManager (UID 0/root, PID 530/NetworkManager)
What: sleep
 Why: NetworkManager needs to turn off networks
Mode: delay

 Who: UPower (UID 0/root, PID 794/upowerd)
What: sleep
 Why: Pause device polling
Mode: delay

 Who: ModemManager (UID 0/root, PID 529/ModemManager)
What: sleep
 Why: ModemManager needs to reset devices
Mode: delay

 Who: PowerDevil (UID 1000/daviding, PID 974/org_kde_powerde)
What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
 Why: KDE handles power events
Mode: block

7 inhibitors listed.

So, Skypeforlinux is listed. However, I also notice that Dropbox is running the tray. Looking at packages, I've got ...

dropbox version 55.4.171-1 ; and
kde-servicemenus-dropbox 0.16.1-9

... installed.

To be thorough, the kernel is 4.17-19-1

$ inxi -Fxz
System: Host: di-x230t-3434cto Kernel: 4.17.19-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.0
Desktop: KDE Plasma 5.13.5 Distro: Manjaro Linux

Quitting Dropbox and invoking a suspend works! What should I do with that knowledge?

2 Likes

This kernel reached end of life quite a while ago, you should move onto 4.18 using mhwd-kernel.

1 Like

Try this before suspend to disable networking completely:

nmcli networking off      

Enable networking:

nmcli networking on           

ModemManager can in all likelihood be disabled completely unless you send faxs regularly.

Now, we're on the right path.

Yes, suspend works when I turn networking off. How do I disable ModemManager (and how would I turn it back on when I need it)? I don't think that I've sent a fax in the last 5 years!

Thanks. I've restored 4.18 (that I had removed earlier).

To stop/disable the ModemManager service:

sudo systemctl stop ModemManager.service && systemctl disable ModemManager.service

To start/enable the ModemManager service:

sudo systemctl enable ModemManager.service && systemctl start ModemManager.service 

A systemd service can be created to automatically turn off/on networking at suspend/resume. I can help you with that. It is not that difficult to do.

1 Like

Creating the following two services should correct your problem.

KILL NETWORK SERVICE - SUSPEND UNIT FILE:

Create Systemd Suspend Unit File:

In a terminal type the following:

sudo nano /etc/systemd/system/kill-network.service

Paste the script contents below with a right click. Exit with CTRL + X and press Y to save.

/etc/systemd/system/kill-network.service unit file contents:

#/etc/systemd/system/kill-network.service
#sudo systemctl enable kill-network.service
[Unit]
Description=Kill network at suspend
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/nmcli networking off

[Install]
WantedBy=sleep.target

Then enable the service:

sudo systemctl enable kill-network.service

Then start the service:

sudo systemctl start kill-network.service

START NETWORK SERVICE - RESUME UNIT FILE:

Create Systemd Resume Unit File:

In a terminal type the following:

sudo nano /etc/systemd/system/start-network.service

Paste the script contents below with a right click. Exit with CTRL + X and press Y to save.

/etc/systemd/system/start-network.service unit file contents:

#/etc/systemd/system/start-network.service
#sudo systemctl enable start-network.service
[Unit]
Description=Restart network at resume
After=suspend.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/nmcli networking on

[Install]
WantedBy=suspend.target

Then enable the service:

sudo systemctl enable start-network.service

Then start the service:

sudo systemctl start start-network.service

Test suspend/resume to see if the new services are now working.

Post any commands that returned errors if the services are not functioning correctly.

Please let me know if that solves your problem.

2 Likes

Hey David.

Just curious if you had any time to test my suggested solution. I see you've been here since I posted the service files and I was hoping to get some feedback from you on there effectiveness in solving your suspend issue.

Please keep us informed of your progress. Any information you've uncovered helps improve the knowledge base on the forum. I'm really curious to know if this fixes your issue.

If those don't work as is, then I'll tweak it till it does.

@tbg Sorry for the slow response. It's not due to lack of interest, just other things going on the same time.

I followed the directions. I started up Dropbox, and then tried to suspend. The suspend problem persists. The screen goes dark with the mouse cursor still showing, followed by the screen saver returning, and then when touch the keyboard, the login screen comes up.

I rebooted the system. Skype and Dropbox both autostarted. I tried to suspend, which didn't work.

Then I exited Skype and Dropbox. Suspend works.

(1) Is there a way (in KDE?) to specify applications that should be exited and restarted to allow suspend to continue. If it's as simple as installing and reinstalling, I could try that.

(2) Should I back out the systemctl changes that I made?

Thanks for the help. This is way deeper than I'm able to handle.

I now recall the I was having problems under Kubuntu 17.04 with Spideroak preventing the suspend from working. Back then, I resorted to installing pm-utils and using pm-suspend, with the hope that it would eventually be fixed in the LTS. The lack of response on this issue in Kubuntu and Ubuntu forum led to my trying out Manjaro. I'm glad that I've made that switch (and have a bigger learning that forum discussions on evolving software in Manjaro may be a better approach than forums plus bug reports in Ubuntu that don't get a response).

1 Like

Have you checked if your Sync apps have their own services? This possibility might interfere these custom services.
Also @tbg maybe the targets could be set differently? For example suspend instead of sleep? I was studying the art of service creation and there are unlimited combinations..
I was thinking of only one custom service with ExecStart and ExecStop commands, with RemainOnExit and Restart combinations.
Maybe at a later (some) time we can brainstorm and test those combinations.. :stuck_out_tongue_winking_eye:

Thanks for the suggestions @AgentS. I find the infinite possibilities very interesting as well. The problem with these service files is, it's hard to troubleshoot the issue unless you can do it with your own system. The average user doesn't have the inclination to test all the possibilities it might take to correct the problem.

I want to get better at writing services as well. It is a lot to learn, and there doesn't seem to be a lot of others familiar enough with systemd to assist.

1 Like

Here's something I've written for you that you may find useful to help with suspend/resume.

Create Custom Desktop Network Stop/Start/Restart Files

You can create custom desktop file(s) to initiate, stop, or perform a network restart. The desktop file(s) can be placed in your start menu, taskbar, or on your desktop to provide an easy one click method to stop/start/restart your network connection. I have chosen the proper icons so it looks exactly like a system desktop shortcut.

Stop your network connection

To stop your network connection create a file named "network-stop.desktop" with a text editor.

The desktop file should have the following contents:

[Desktop Entry]
Categories=Internet;Network;
Comment[en_CA]=Stop network connection.
Comment=Stop network connection.
Encoding=UTF-8
Exec=/usr/bin/nmcli networking off
GenericName[en_CA]=Stop Network
GenericName=Stop Network
Icon=network-wireless-disconnected
Keywords=network;internet;
MimeType=
Name[en_CA]=Stop Network
Name=Stop Network
NoDisplay=true
Path=
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Save the file, and make the newly created desktop file executable.

Then place the desktop file in your start menu (~/.local/share/applications), taskbar, or on your desktop.

Start your network connection

To start yor network connection create a file named "network-start.desktop" with a text editor.

The desktop file should have the following contents:

[Desktop Entry]
Categories=Internet;Network;
Comment[en_CA]=Start network connection.
Comment=Start network connection.
Encoding=UTF-8
Exec=/usr/bin/nmcli networking on; sleep 2; exit
GenericName[en_CA]=Start Network
GenericName=Start Network
Icon=network-wireless-connected-100
Keywords=network;internet;
MimeType=
Name[en_CA]=Start Network
Name=Start Network
NoDisplay=true
Path=
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Save the file, and make the newly created desktop file executable.

Then place the desktop file in your start menu (~/.local/share/applications), taskbar, or on your desktop.

Restart your network connection

To restart your network connection create a file named "network-restart.desktop" with a text editor.

The desktop file should have the following contents:

Desktop Entry]
Categories=Internet;Network;
Comment=Restart network connection.
Encoding=UTF-8
Exec=/bin/nmcli r all off; sleep 5; nmcli r all on; sleep 2; exit
GenericName=Restart Network
Icon=network-manager
Keywords=network;internet;
Name=Restart Network
NoDisplay=true
Path=
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Save the file, and make the newly created desktop file executable.

That's not quite as automated as the service file method, but all you have to do is click the icon to start or stop your network.

Close enough to make it fairly painless to suspend/resume.

Hope that helps.

A little more testing for problem determination. (It's a holiday weekend in Canada).

Looking for things that might be running in the background and/or in the tray, I uninstalled ...

  • Dropbox
  • Skype
  • Owncloud
  • Spideroak

... and rebooted the Thinkpad. Trying suspend didn't work ... which surprised me.

So what else could be the issue?

$ systemctl list-unit-files | grep enabled
org.cups.cupsd.path enabled
autovt@.service enabled
avahi-daemon.service enabled
bluetooth.service enabled
cronie.service enabled
dbus-org.bluez.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
getty@.service enabled
haveged.service enabled
kill-network.service enabled
ModemManager.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
org.cups.cupsd.service enabled
sddm.service enabled
start-network.service enabled
systemd-fsck-root.service enabled-runtime
systemd-timesyncd.service enabled
tlp-sleep.service enabled
tlp.service enabled
avahi-daemon.socket enabled
org.cups.cupsd.socket enabled
remote-fs.target enabled
pamac-cleancache.timer enabled
pamac-mirrorlist.timer enabled

I thought that maybe stopping ModemManager might help.

$ sudo systemctl stop ModemManager.service && systemctl disable ModemManager.service
Removed /etc/systemd/system/dbus-org.freedesktop.ModemManager1.service.
Removed /etc/systemd/system/multi-user.target.wants/ModemManager.service.

Nope, trying suspend again didn't work. (I'll reinstall those four apps, now).

Try disabling all three, reboot, then test suspend.

No joy.

Suspend doesn't work. (dbus-org.bluez.service is associated with bluetooth.service, so invoking the latter does the former).

Consistently, stopping the full network service ....

... does continue to work, and then restarting restores.

So, we have a workaround. We don't have a full resolution though.

This is a random idea, and has nothing to do with network management, but ... could this a problem with KDE (or SDDM, which I don't really understand)? The only other weird thing that I've done is to have Configure Screen Locking ... Wallpaper Type: Slideshow ... which is pointing to a directory on the NTFS mounted drive (while KDE Manjaro is installed on a mSATA drive). I've reset the Wallpaper Type to Image ... and now the computer suspends. That's weird.

I'm fairly sure this will be resolved with a service file to stop/restart networking. We just haven't found the right combination yet. I'm rewriting your service files, give me a few mins.

Try this:

Suspend unit:

/etc/systemd/system/kill-network.service unit file contents:

#/etc/systemd/system/kill-network.service
#sudo systemctl enable kill-network.service
[Unit]
Description=Kill network at suspend
Before=sleep.target


[Service]
Type=oneshot
RemainAfterExit=yes
ExecStarPre=/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/nmcli networking off

[Install]
WantedBy=sleep.target

Resume unit:

/etc/systemd/system/start-network.service unit file contents:

#/etc/systemd/system/start-network.service
#sudo systemctl enable start-network.service
[Unit]
Description=Restart network at resume
After=suspend.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStarPre=/usr/bin/systemctl start NetworkManager
ExecStart=/user/bin/nmcli networking on

[Install]
WantedBy=suspend.target

Overwrite the old service files contents with the new.

Restart.

Just reread. So suspend is working properly now?

That would definitely interfere with suspend if accessing a network source for that. That should be a local source.

I've been continuing testing, and it seems as though we've determined the problem.

So, I guess that "local source" means that the slideshow directory has to be under the /home directory (on the booted mSATA), and it can't be on a second (mounted) drive (i.e a SATA defined in the FSTAB).

I wouldn't have thought that suspend with a kill-network.service would have an effect on mounted drives, but I guess it does.

The mounted drive isn't a problem with pm-suspend. so the change with systemd has had an impact.

The workaround is obviously not to use the screensaver pointing to a mounted drive when trying to suspend.

Thanks for the help.

Just to be thorough, we've been working on this problem long enough that there's another system update, so here's the configuration.

$ inxi -Fxcz
System: Host: di-x230t-3434cto Kernel: 4.18.12-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1
Desktop: KDE Plasma 5.13.5 Distro: Manjaro Linux
Machine: Type: Laptop System: LENOVO product: 3434CTO v: ThinkPad X230 Tablet serial:
Mobo: LENOVO model: 3434CTO serial: UEFI [Legacy]: LENOVO v: GCETB1WW (2.71 )
date: 06/19/2018
Battery: ID-1: BAT0 charge: 56.1 Wh condition: 56.2/57.2 Wh (98%) model: SANYO 45N1177 status: Unknown
CPU: Topology: Dual Core model: Intel Core i7-3520M bits: 64 type: MT MCP arch: Ivy Bridge rev: 9
L2 cache: 4096 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23154
Speed: 1802 MHz min/max: 1200/3600 MHz Core speeds (MHz): 1: 1802 2: 2020 3: 1825 4: 2561
Graphics: Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel bus ID: 00:02.0
Display: x11 server: X.Org 1.20.1 driver: intel unloaded: modesetting
resolution: 1366x768~60Hz, 1680x1050~60Hz
OpenGL: renderer: Mesa DRI Intel Ivybridge Mobile v: 4.2 Mesa 18.2.2 direct render: Yes
Audio: Device-1: Intel 7 Series/C216 Family High Definition Audio driver: snd_hda_intel v: kernel
bus ID: 00:1b.0
Sound Server: ALSA v: k4.18.12-1-MANJARO
Network: Device-1: Intel 82579LM Gigabit Network driver: e1000e v: 3.2.6-k port: 6080 bus ID: 00:19.0
IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac:
Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi v: kernel port: efa0
bus ID: 03:00.0
IF: wlp3s0 state: up mac:
Drives: Local Storage: total: 1.13 TiB used: 528.28 GiB (45.7%)
ID-1: /dev/sda vendor: Western Digital model: WD10SPCX-22HWST0 size: 931.51 GiB
ID-2: /dev/sdb vendor: Crucial model: CT240M500SSD3 size: 223.57 GiB
Partition: ID-1: / size: 48.16 GiB used: 21.19 GiB (44.0%) fs: ext4 dev: /dev/sdb7
ID-2: /home size: 69.57 GiB used: 34.70 GiB (49.9%) fs: ext4 dev: /dev/sdb5
ID-3: swap-1 size: 15.30 GiB used: 11.2 MiB (0.1%) fs: swap dev: /dev/sdb6
Sensors: System Temperatures: cpu: 63.0 C mobo: N/A
Fan Speeds (RPM): cpu: 3865
Info: Processes: 267 Uptime: 1d 1h 28m Memory: 15.37 GiB used: 7.27 GiB (47.3%) Init: systemd Compilers:
gcc: 8.2.1 Shell: bash v: 4.4.23 inxi: 3.0.26

Glad to hear you got everything working. Please mark the thread solved if everything is working satisfactorily for you now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by