I noticed that with Syncthing on Ubuntu configured as a service it prevents suspend. More correctly it does not prevent suspend but it makes computer wake up shortly after suspend. I looked at similar topics on this forum and there was a suggestion to disable watchers. This seems to work but I wander how Syncthing get updates from the file system in this case. My understanding it will only get updates on periodic scans which are only once an hour. Is this correct and if that is the case is there any way to handle it better?
Suspend mode (suspend-to-RAM or suspend-to-disk) involves hardware power management, so waking up the computer requires an external trigger such as HID input, power button, RTC alarm signal, etc.
Drives are powered down and the CPU enters a low power state, so Ubuntu isn’t technically running, which also means that Syncthing cannot wake the computer.
It sounds more like the power settings are allowing drive activity to interrupt entering suspend mode after the display goes to sleep for a preset amount of time.
Questions…
- What type of hardware? (e.g. laptop, desktop, make, model)
- Which version of Ubuntu? (e.g. desktop/server, version)
The “shortly” makes me think that the computer didn’t actually reach the suspended state because something was blocking it so it came back. I suppose Ubuntu is using systemd these days. That means you could trigger suspension manually via sudo systemctl restart systemd-suspend.service
to rule out the UI-layer is at fault. You can also check logs for problems via sudo journalctl -fu systemd-suspend.service
. In any case dmesg
and sudo cat /proc/acpi/wakeup /sys/kernel/debug/suspend_stats
might also provide useful information. Most likely none of this will reveal Syncthing as the culprit, though.
As @gadget mentioned, it might be some device waking up your system. This is actually a useful feature. To disable it for a specific device making problems, you can use something like this:
cat /etc/udev/rules.d/50-logitech.rules
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c52b", ATTR{power/wakeup}="disabled"
sudo udevadm control --reload-rules
I know it does not make sense but something in Syncthing causes a wake up. If I disable watchers in advanced settings computer does not wake up. But there should’t be any disk I/O while in suspend state so I don’t understand it.
Computer in question is desktop, build by me some time ago. The specs are as follows:
- Motherboard: Asus Pro WS WRX80E Sage
- CPU: AMD 3995WX
- RAM: Gskill 256 GB 3600 MHz
- GPU: Asus TUF 4090 OC
- Storage: seven WD SN850 2TB SSDs
- OS: Ubuntu desktop 22.10 with all updates.
The watchers use inotify under the hood. If that really changes the kernel’s behaviour than I suppose there’s not much one could do about it (from Syncthing’s side).
Even if your hardware specs and OS might be relevant, I doubt anybody here knows its particularities well enough to provide help based on them. I suggest you check dmesg
and the other places I’ve mentioned before. Normally there are some clues there to be found.
Would you mind posting the output from cat /proc/acpi/wakeup
?
The spec sheet says that the WRX80E-SAGE has onboard Wi-FI. Is your desktop on a wired or wireless network connection?
Thanks for all your help. I will investigate logs etc. as you suggested. For now I will live with the manual kludge. I created two 1-2 liner scripts. The first is called “suspend” and will stop Syncthing service followed by suspend (“systemctl suspend -i”). The other is called “resume” and will start Syncthing service. I just have to remember to call them.
Motherboard has WiFi and two 10G Ethernet connections. I always run on 10G Ethernet.
Output of cat /proc/acpi/wakeup as follows:
vitali@tachi:~$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
D0A0 S4 *enabled pci:0000:00:01.1
D0A1 S4 *disabled
D0A2 S4 *disabled
D0A3 S4 *disabled
D0A4 S4 *disabled
D0A5 S4 *disabled
D0A6 S4 *disabled
D0A7 S4 *disabled
D0B0 S4 *disabled
D0B1 S4 *disabled
D0B2 S4 *disabled
D0B3 S4 *disabled
D0B4 S4 *disabled
D0B5 S4 *disabled
D0B6 S4 *disabled
D0B7 S4 *disabled
D0C0 S4 *enabled pci:0000:00:07.1
D0B8 S4 *enabled pci:0000:00:08.1
PS2K S3 *disabled
PS2M S3 *disabled
D1A0 S4 *disabled
D1A1 S4 *disabled
D1A2 S4 *disabled
D1A3 S4 *disabled
D1A4 S4 *disabled
D1A5 S4 *disabled
D1A6 S4 *disabled
D1A7 S4 *disabled
D1B0 S4 *enabled pci:0000:20:03.1
D1B1 S4 *enabled pci:0000:20:03.2
D1B2 S4 *disabled
D1B3 S4 *disabled
D1B4 S4 *disabled
D1B5 S4 *disabled
D1B6 S4 *disabled
D1B7 S4 *disabled
D1C0 S4 *enabled pci:0000:20:07.1
D1B8 S4 *enabled pci:0000:20:08.1
D2A1 S4 *disabled
D2A2 S4 *enabled pci:0000:40:01.3
D2A3 S4 *enabled pci:0000:40:01.4
D2A4 S4 *disabled
D2A5 S4 *disabled
D2A6 S4 *disabled
D2A7 S4 *disabled
D2B0 S4 *disabled
D2B1 S4 *disabled
D2B2 S4 *disabled
D2B3 S4 *disabled
D2B4 S4 *disabled
D2B5 S4 *disabled
D2B6 S4 *disabled
D2B7 S4 *disabled
D2C0 S4 *enabled pci:0000:40:07.1
D2A0 S4 *enabled pci:0000:40:01.1
D3A0 S4 *disabled
D3A1 S4 *disabled
D3A2 S4 *disabled
D3A3 S4 *disabled
D3A4 S4 *disabled
D3A5 S4 *disabled
D3A6 S4 *disabled
D3A7 S4 *disabled
D3B0 S4 *disabled
D3B1 S4 *disabled
D3B2 S4 *disabled
D3B3 S4 *disabled
D3B4 S4 *disabled
D3B5 S4 *disabled
D3B6 S4 *disabled
D3B7 S4 *disabled
D3C0 S4 *enabled pci:0000:60:07.1
I posted a reply but some anti-spam filter disabled it. The motherboard has WiFi and two 10G Ethernets. I always run on 10G Ethernet. Content of /proc/acpi/wakeup is below.
vitali@tachi:~$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
D0A0 S4 *enabled pci:0000:00:01.1
D0A1 S4 *disabled
D0A2 S4 *disabled
D0A3 S4 *disabled
D0A4 S4 *disabled
D0A5 S4 *disabled
D0A6 S4 *disabled
D0A7 S4 *disabled
D0B0 S4 *disabled
D0B1 S4 *disabled
D0B2 S4 *disabled
D0B3 S4 *disabled
D0B4 S4 *disabled
D0B5 S4 *disabled
D0B6 S4 *disabled
D0B7 S4 *disabled
D0C0 S4 *enabled pci:0000:00:07.1
D0B8 S4 *enabled pci:0000:00:08.1
PS2K S3 *disabled
PS2M S3 *disabled
D1A0 S4 *disabled
D1A1 S4 *disabled
D1A2 S4 *disabled
D1A3 S4 *disabled
D1A4 S4 *disabled
D1A5 S4 *disabled
D1A6 S4 *disabled
D1A7 S4 *disabled
D1B0 S4 *enabled pci:0000:20:03.1
D1B1 S4 *enabled pci:0000:20:03.2
D1B2 S4 *disabled
D1B3 S4 *disabled
D1B4 S4 *disabled
D1B5 S4 *disabled
D1B6 S4 *disabled
D1B7 S4 *disabled
D1C0 S4 *enabled pci:0000:20:07.1
D1B8 S4 *enabled pci:0000:20:08.1
D2A1 S4 *disabled
D2A2 S4 *enabled pci:0000:40:01.3
D2A3 S4 *enabled pci:0000:40:01.4
D2A4 S4 *disabled
D2A5 S4 *disabled
D2A6 S4 *disabled
D2A7 S4 *disabled
D2B0 S4 *disabled
D2B1 S4 *disabled
D2B2 S4 *disabled
D2B3 S4 *disabled
D2B4 S4 *disabled
D2B5 S4 *disabled
D2B6 S4 *disabled
D2B7 S4 *disabled
D2C0 S4 *enabled pci:0000:40:07.1
D2A0 S4 *enabled pci:0000:40:01.1
D3A0 S4 *disabled
D3A1 S4 *disabled
D3A2 S4 *disabled
D3A3 S4 *disabled
D3A4 S4 *disabled
D3A5 S4 *disabled
D3A6 S4 *disabled
D3A7 S4 *disabled
D3B0 S4 *disabled
D3B1 S4 *disabled
D3B2 S4 *disabled
D3B3 S4 *disabled
D3B4 S4 *disabled
D3B5 S4 *disabled
D3B6 S4 *disabled
D3B7 S4 *disabled
D3C0 S4 *enabled pci:0000:60:07.1
type or paste code here
Motherboard has WiFi and two 10G Ethernets. I always run 10G Ethernet. I tried to post content of /proc/acpi/wakeup but antispam filter in this forum disabled them. Maybe it will appear later.
After looking at logs etc I believe this problem has nothing to do with Syncthing. Thanks everyone for the help.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.