Need some help with discosrv on linux server

I am a Windows user, and somewhat unfamiliar with linux commands. I already have a functioning installation of Syncthing v0.11.5 on a remote linux VPS. The OS is 32 bit ubuntu.

I’d like to attempt a discovery server installation on the VPS. I have a few questions … any assistance will be appreciated!

(1) Can I install discosrv in the same folder as Syncthing in the server, and have both executables running simultaneously?

(2) Can Syncthing on the server point to discosrv on the same server for global discovery?

(3) Is there any documentation describing the commands for downloading and installing discosrv in linux + some upstart scripting (or equivalent) so it starts up when the server is rebooted?

If there is no existing documentation, I’ll be happy to create this content and upload it to the wiki - assuming I successfully navigate thru this project.

Thanks.

Yes

Kinda… It can look up other devices that way, at least. It’s own announcement may not get the correct address, depending on your setup.

There’s GitHub - syncthing/discosrv: The Syncthing global discovery server, but it doesn’t include stuff about auto starting it. There are articles about that for syncthing though, and the exact same ways can be used for the discosrv.

Thanks for the wiki link. I’ve made some progress, but my other devices are not yet connecting with my own discovery server. Here’s where I am:

(1) discosrv (linux 32 bit) is installed and running in /usr/local/bin/ with the same properties as Syncthing (root:root 0755)

(2) discosrv created a database in /var/discosrv/ when it first ran.

(3) I now have a configured upstart script to auto-launch discosrv - located at /etc/init/discosrv.conf - similar to the one I already use for the syncthing executable.

(4) Pointed remote device to udp4://vpn.server.address:22026, udp6://vpn.server.address:22026 - but I get no connection to this discovery server. My VPN provider says “all ports are open by default” - so I don’t think an iptables firewall is in the way. I did “sudo ufw allow 22026” - (just in case), and received “rules updated”.

If there’s something obviously wrong with this setup, please let me know. Thanks

EDIT: “sudo netstat -ntulp” doesn’t list discosrv as a listening service - syncthing is shown listening on several ports, so I think this might be indicating the problem.

-t implies TCP, and discovery is done via UDP, so drop that option. I am pretty sure it will be your VPN to blame. You can do: netcat -l 22445 on the server which is due to run the discovery server, and echo test>/dev/tcp/<ip of discoveryserver/22445 to see if you receive it at the other end.

Yup. Tried netstat -ulp to hide the TCP connections: discosrv using UDP is not seen - and nothing is displayed using port 22026.

I didn’t do the suggested echo test, I don’t have another linux device at the moment.

Pretty sure the problem is with discovery server setup on the VPN.

Well check if it’s running to start with, and if it is, check the console output when running it manually (don’t run it through upstart)

SUCCESS!

As you suggested, I removed the upstart script, and started discosrv manually with the the following flag: -listen=“:22026”

Following this, netstat -ulp revealed that discosrv was now listening on port 22026 UDP … and then my devices connected to the discovery server.

The last remaining problem; discosrv stopped running when I closed the putty ssh console. This was fixed by nohup &. The working command to start discosrv is: nohup sudo discosrv -listen=“:22026” & After entering this command, I can close putty and the discovery server stays alive.

I will organize my notes and add them to the discosrv wiki. Thank you @AudriusButkevicius and @calmh.

You can use discosrv -listen=":22026" & disown if you are using bash, which doesn’t require nohup installed.