4

I have Ubuntu 17.10. When I enable "Power Saving / Blank screen" and screen locks after N minutes, all running applications shut down. Is it normal? If no how can I fix it?

a153
  • 63

2 Answers2

2

You may be experiencing the problem described in this question, which I asked in response to your question because your question had attracted comments that did not address the problem.

In my case, the problem was that the Wayland X server was crashing immediately after blanking the screen. The solution was to switch to the legacy Xorg server, by choosing "Ubuntu on Xorg" as the session type when logging in. You do this by clicking the gear icon next to the "Sign In" button on the login screen, after selecting your user from the user list.

JKna
  • 93
  • 1
  • 7
  • I have installed Debian 9 instead Ubuntu and can't check this issue now but seems like you are right. Thank you anyway :) – a153 Apr 11 '18 at 05:16
1

Reference: https://help.ubuntu.com/stable/ubuntu-help/power-suspend.html

When you suspend the computer, you send it to sleep. All of your applications and documents remain open, but the screen and other parts of the computer switch off to save power. The computer is still switched on though, and it will still be using a small amount of power. You can wake it up by pressing a key or clicking the mouse. If that does not work, try pressing the power button.

Some computers have problems with hardware support which mean that they may not be able to suspend properly. It is a good idea to test suspend on your computer to see if it does work before relying on it.

First check if it's acting the way it should. The Official Documentation is a great resource for that.

If there is a problem, start by looking at your logging to understand what's happening. dmesg makes it easy. It grabs things from /var/log so you don't have to poke around as much.

user@hostname:~ $ dmesg
[    0.000000] Booting Linux on physical CPU 0xf00
[    0.000000] Initializing cgroup subsys cpuset

You can also use grep to look for log entries relating to power stuff. This shows the format difference for syslog from grep. dmesg is counting the time from startup, so 5.000000 would be five seconds after the kernel starts.

user@hsotname:~ $ sudo cat /var/log/syslog | grep -iE "power|sleep|shutdown"
Jan 15 21:56:49 hostname systemd[11559]: Starting Shutdown.
Jan 15 21:56:49 hostname systemd[11559]: Reached target Shutdown.

Reference: https://help.ubuntu.com/community/LinuxLogFiles

Reference: https://unix.stackexchange.com/questions/37313/how-do-i-grep-for-multiple-patterns

musicman1979
  • 1,147
  • 1
  • 9
  • 26
  • Suspend works fine, not a problem. But after screen goes blank i can see in logs: Jan 16 09:33:00 pc-ubuntu systemd[5453]: Reached target Shutdown. Jan 16 09:47:00 pc-ubuntu systemd[7494]: Reached target Shutdown. Jan 16 09:55:00 pc-ubuntu systemd[8422]: Reached target Shutdown. – a153 Jan 16 '18 at 07:58
  • "The screen goes blank," do you mean when the screen locks? Try this to adjust the lock time: https://help.ubuntu.com/stable/ubuntu-help/session-screenlocks.html. Try this to adjust the blanking time: https://help.ubuntu.com/stable/ubuntu-help/display-blank.html. If you still need help please use explicit terminology to describe: 1. what you want to do and 2. what happens when it doesn't work. Reference for power terminology: https://help.ubuntu.com/stable/ubuntu-help/shell-exit.html. – musicman1979 Jan 16 '18 at 21:42
  • Sorry, I mean screen lock, but in settings it's named as "Blank screen". I want my applications continue running after screen locks. But instead all applications shut down when screen locks. – a153 Jan 16 '18 at 21:56
  • try removing the automatic suspend setting, or make it longer (maybe 8hrs). "In the Suspend & Power Button section, click Automatic suspend." So modify this setting. – musicman1979 Jan 16 '18 at 22:07
  • I have turned it off. But it's not a good option. – a153 Jan 16 '18 at 22:09
  • that's the intention of the suspend; it's working the way it should be. feel free to ask another question if you have another concern. if this got you working though please mark as answered. – musicman1979 Jan 16 '18 at 22:12
  • But suspend and screen lock is not the same. My concern is about screen lock, not about suspend. – a153 Jan 16 '18 at 22:27