Multiple syncthing instances after auto update

I came across a problem when using supervisord to manage syncthing. After it automatically updates, it will restart and cause multiple instances to run (I counted 4). Normally with supervisord managing syncthing I see 2 processes.

Anyway, the fix or workaround seems to be adding this environment variable: environment=STNORESTART=“1”

I went ahead and added it to the wiki here:

Interestingly, after adding that variable, I only get one instance of syncthing (instead of the usual two) and it still works fine. I also tested auto-update and it appears to work correctly as well; syncthing updates, shuts down, and then supervisor restarts it properly.

Is this a bug? Or intended feature?

It is intended that you use STNORESTART when it’s being managed by something other than itself. The other examples (runit, systemd, etc) should do this correctly at least.

I think he is also asking how syncthing restarts itself on a config change when there is no syncthing process managing syncthing.

Syncthing’s exit code will indicate whether it wants to be restarted. The systemd script lists these