PDA

View Full Version : systemd and syncthing autoupdate causing ps hang



wangmaster
14th June 2016, 10:43 PM
I'm running into an interesting problem. I use syncthing and configured a systemd unit:



[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
Wants=syncthing-inotify@.service

[Service]
User=%i
ExecStart=/path/to/syncthing/syncthing -no-browser -no-restart -logflags=0
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4

[Install]
WantedBy=multi-user.target



Syncthing has an autoupdate mechanism. It appears to replace syncthing and somehow restart itself. When this happens syncthing hangs, which is the least of my problems. The resulting hang causes ps to hang. Here's the strace output:



stat("/proc/8026", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/8026/stat", O_RDONLY) = 6
read(6, "8026 (syncthing) D 1 8026 8026 0"..., 2048) = 330
close(6) = 0
open("/proc/8026/status", O_RDONLY) = 6
read(6, "Name:\tsyncthing\nState:\tD (disk s"..., 2048) = 1120
close(6) = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 6
fstat(6, {st_mode=S_IFREG|0644, st_size=2558, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6e27264000
read(6, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2558
close(6) = 0
munmap(0x7f6e27264000, 4096) = 0
open("/proc/8026/cmdline", O_RDONLY) = 6
read(6,


Based on this
https://rachelbythebay.com/w/2014/10/27/ps/
I'm wondering if it's a similar problem where the systemd unit just doesn't like when a new process shows up in the cgroup.

Anyone run into anything like this and have any suggestions? Is there something that i could potentially set on the service unit file that might prevent the hang? When this happens I can't even kill -9 the pid. I've only been able to reboot and actually end up needing to forcibly reboot/reset the system sometimes.