Running Stdiscosrv on boot

Hello.

We’ve run into an issue with starting stdiscosrv on boot.

Previously we’ve run the discovery server on a workstation, manually or set it up to run on login and it’s worked great. But now we have moved to a headless server with Windows Server 2022 and need it to run on boot.

If we run the discovery server manually it works, but as soon as we run it from a task in task scheduler to run on boot we get a different device ID. At least that is what our clients complain about.

Is there a way to find the device ID of a running server when the prompt window isn’t shown? I cannot find anything about it in the documents.

We are still novices in running and maintaining our own servers and services, but we are learning as we go.

Make sure to configure the task in Task Scheduler for the correct command line switches (you may need to change single hyphen options to double hyphen) and directory to start the task in.

How did you “move” to a different server? Where did you put Syncthing’s configuration and keys? Make sure that either you specify that path explicitly via command line options in your scheduled task, or that it’s in the default place where Syncthing will look, depending on the user account which is set for the task.

1 Like

Apologize for the bad wording. The “move” wasn’t a move as in such, we set up a new discovery server on the win server 2022. Manually ran the stdiscosrv.exe without options, using the default values as that is enough for the time being, used the output ID and set up our clients with the IP and ID.

We then made a task, pointing to the same stdiscosrv.exe, set it to run with the same account and set it to run regardless if logged in or not. We didn’t use any options here either. Restarted the server.

The clients showed error on the new discovery server that the ID didn’t match.

I’m not very experienced with the discovery server command line, in contrast to the main Syncthing command. But what you could look at is whether it somehow prints out the paths used to store configuration and identity. Compare that to the output from the scheduled task.

Environment variables may be different for the user if run interactively or from task scheduler. Just one more thing to look out for.

We had to specify the folder for the cert and key files, even though they were the default values.

The scheduled task must’ve created them separately for the instance.

1 Like

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