Unable to find a version that works as a service on Ubuntu 22.04 or Ubuntu 20.04

Hello all! I’ve been having trouble recently. I love Syncthing and have been syncing music projects with friends, backup photos and images, works like a charm. My main issue is that for as long as I’ve been using Syncthing, I cannot manage to make it work as a service.

I followed the official guide on how to do this, but it seems that I might be doing something wrong. I’ve used the official new versions of Syncthing (>1.16) for a while, they autoupdate fine, but the guide has not enabled me to run as a service. I’ve tried some of the most common solutions, but nothing seems to work. Now I thought it would be a good idea to check out the apt versions. I added the repo and ppa correctly, but it seems it will only install sync v1.13. Now this would not be an issue if that version actually started manually. Starting it manually gives this output:

I’ve also tried forcing with the command option it suggested (something like -force new config) but it gave the same result. So I tried using the official version (v1.20 at this time) to make a user service, but it refuses to start and gives reason that it restarted too quickly, even though I changed the config to reduce that time. And for some reason this “systemctl start” command also seemed to have a “–no-restart” within it. (>v1.16 have been fine other than service)

I just want to have Syncthing setup as a service, but it is possible I can not do it on Ubuntu due to configuration. If you need any more info, please tell me, I have been working on enabling this for two days.

This is the output from the service (and yes this is just because I disabled the config to attempt to repair everything (i also used systemctl --user daemon-reload at some points):

I’ve also tried many computers with the same result. I can autostart on Windows with a simple script (easy), but can I do that here? It’ll even work in the background with no issues on mobile. Sorry to bother people if this is an issue that is simply solved, I just can’t seem to find any easy fixes on googleable forums. In case system info is needed:

(A couple days ago I updated my better computer to Ubuntu 22.04.1 and have been unhappy since, but it seems Ubuntu has compatibility for most apps. Opening Syncthing manually has been working fine since Ubuntu 20.04.1 and kernels 5.8)

What guide? Probably not the official one from Syncthing’s perspective, because you are running an ancient version.

The config points to the same issue: You were running an up-to-date version (as you describe it likely downloaded the syncthing binary manually), now you are likely running a vastly outdated version provided by Ubuntu (which is weird, Debian is much more up-to-date and that’s what Ubuntu is based upon).

Anyway, likely the problem will solve itself if you either install from apt.syncthing.net or download the binary from Syncthing | Downloads (and remove whatever you have installed now). If that doesn’t help, please describe what you did to setup syncthing.

I managed to find the logs within journalctl and the problem I was having to start syncthing v1.13 could also be applied to systemctl. So I found the multi-user.target.wants folder, applied changes and it worked (v1.18, v1.13). Also for some reason updating from Ubuntu 20.04 to 22.04 fixed where the computer installed from, so now Ubuntu installs v1.20. I’m confused as to why this happened, but it seems its working now. As well, ubuntu provides packages so old that they are incompatible with the actual functionality, so I’m not surprised that older versions were a thing.

In short: #1 - Ubuntu for some reason would not install above v1.13 (whether correct download location was signified or not) on Ubuntu 20.04, but would on 22.04. Weird. (I know for certain it was the OS, because I had signified the ppa, and it suddenly autoupdated after upgrading to 22.04)

#2 - For versions older than current (for cases where ubuntu will install less than current), the fix was to add “–allow-newer-config” to the end of run options in the service config. (later versions of ubuntu seem to also install newer versions of syncthing, up to v1.18)

In case this is useful for people who do not understand how any of the configuration works, we either go to /etc/systemd/system/multi-user.target.wants/syncthing@[youruser].service or ~/.config/systemd/user/syncthing@[youruser].service (This may not be useful if you followed the guide step by step)

I think this fix will also work if you install it yourself manually, check the journal, append the option, but I haven’t checked.

This guide was helpful (the one I used. I am often quick and stubborn, so I overlooked the journalctl command): Starting Syncthing Automatically — Syncthing documentation

Thank you very much for your help anyways!

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