I get the following warning due to the new priority setting:
Failed to lower process priority: set process group: operation not permitted
This occurs when running Syncthing as a system service. Just for testing, I also tried it running as root (
syncthing@root) and the same error occurs. The error does not happen when I run syncthing manually. So it seems systemd prevents some operation.
If this is not a problem on my side or there is no fix in the code (e.g. it’s simply a mystery what systemd does ), we could add an environment variable to disable the internal low priority thing and add it to the shipped systemd service files with the
Can you post
ps -ejH for that system when syncthing is running, at least the part of the tree that relates from systemd down to syncthing? I’m interested in the PID/SID/PGID relations here
syncthing process is directly below the main
PID PGID SID TTY TIME CMD
1 1 1 ? 00:07:58 systemd
14238 14238 14238 ? 00:00:34 syncthing
Right, so it’s already in it’s own session and process group, which is why the call fails. My patch above should work.
(It’s “neat” that it returns
EPERM to indicate that the operation would be a no-op, but that’s the POSIX spec apparently…)
Just to double check, does it actually manage to nice itself still?
Just for reference: If you manually set the
Nice option in the systemd service (like I do - I obviously disabled for testing), syncthing still warns about not being able to set niceness, but that’s expected and a user config problem, not syncthings problem (and the error message is nicely descriptive).
I think we should check for that and never attempt to raise our priority…
I have thought that falls into the too remote use case to be worth handling, but I won’t complain if works automatically
As much as I want the bare minimum here, attempting to raise our priority and then complaining to the user is clearly a bug, compounded by then being annoying.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.