Discovery Server on rPi

Hello all. I wanted to post here before logging a bug. I am trying to run stdiscosrv on a Raspberry Pi 4 revB. I have the latest image (as of this writing) of raspbian installed. I followed all the directions at https://apt.syncthing.net/ and all commands executed without issue. I have done apt update and upgrade on my system and all seems well. When I try to run stdiscosrv I get the below code that just repeats forever… what am I missing/doing wrong here? I have tried simply rebooting to see if it frees up the port (referencing the "address already in use within the error code), if the port being in use is indeed the real issue here…

pi@raspberrypi:/ $ sudo stdiscosrv stdiscosrv v1.8.0 “Fermium Flea” (go1.13.8 linux-arm) deb@build.syncthing.net 2020-08-07 06:09:12 UTC [noupgrade] Server device ID is [DEVICE ID OMITTED BY AUTHOR ON PURPOSE] Listen: listen tcp :8443: bind: address already in use Replication listen: listen tcp :19200: bind: address already in use Supervisor main: main: Failed service ‘&main.apiSrv{addr:":8443", cert:tls.Certificate{Certificate:[][]uint8{[]uint8{0x30, 0x82, 0x1, 0x9c, 0x30, 0x82, 0x1, 0x22, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x8, 0x79, 0x60, 0xb6, 0xeb, 0xf3, 0xe8, 0xbe, 0x5, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x72, 0x76, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x31, 0x30, 0x37, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0xd, 0x34, 0x31, 0x30, 0x37, 0x30, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 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a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x3, 0x68, 0x0, 0x30, 0x65, 0x2, 0x30, 0x60, 0x1, 0xe, 0x9, 0x8, 0xd3, 0x25, 0xad, 0xe7, 0xfd, 0x10, 0x92, 0x4, 0x81, 0x9c, 0x1e, 0x66, 0xb3, 0x66, 0x3c, 0x4, 0x1c, 0x7f, 0xbf, 0xb9, 0x99, 0x5d, 0x5c, 0xcd, 0x35, 0xfd, 0x38, 0x3c, 0x7f, 0x98, 0xec, 0x31, 0xd1, 0x47, 0x37, 0x71, 0xc9, 0xfa, 0xd1, 0xd9, 0xbe, 0xf9, 0x37, 0x2, 0x31, 0x0, 0xca, 0x31, 0xf2, 0x1d, 0x3, 0xaf, 0xbb, 0x4e, 0xe2, 0x1c, 0xa1, 0x24, 0x36, 0x97, 0x7a, 0x3d, 0x56, 0x27, 0x8e, 0x82, 0xff, 0xe1, 0x1d, 0x7a, 0xa0, 0x67, 0xbf, 0xa6, 0x60, 0x21, 0x87, 0xe2, 0x84, 0x38, 0xf2, 0x99, 0xf8, 0xa0, 0x8a, 0x54, 0xe2, 0xf9, 0x27, 0x71, 0x1e, 0xea, 0x9e, 0xe8}}, PrivateKey:(*ecdsa.PrivateKey)(0x2d04de0), OCSPStaple:[]uint8(nil), SignedCertificateTimestamps:[][]uint8(nil), Leaf:(*x509.Certificate)(nil)}, db:(*main.levelDBStore)(0x2d66460), listener:net.Listener(nil), repl:main.replicationMultiplexer(nil), useHTTP:false, mapsMut:sync.Mutex{state:0, sema:0x0}, misses:map[string]int32{}}’ (1.000000 failures of 5.000000), restarting: true, error: “{%!s(*main.apiSrv=&{:8443 {[[48 130 1 156 48 130 1 34 160 3 2 1 2 2 8 121 96 182 235 243 232 190 5 48 10 6 8 42 134 72 206 61 4 3 2 48 21 49 19 48 17 6 3 85 4 3 19 10 115 116 100 105 115 99 111 115 114 118 48 30 23 13 50 49 48 55 49 50 48 48 48 48 48 48 90 23 13 52 49 48 55 48 55 48 48 48 48 48 48 90 48 21 49 19 48 17 6 3 85 4 3 19 10 115 116 100 105 115 99 111 115 114 118 48 118 48 16 6 7 42 134 72 206 61 2 1 6 5 43 129 4 0 34 3 98 0 4 215 159 242 162 220 219 116 249 88 66 197 199 105 220 57 89 1 212 63 109 214 38 96 187 175 87 253 35 72 58 119 115 45 106 92 59 238 62 129 109 187 133 19 252 29 27 169 123 70 22 102 157 68 218 179 180 245 170 254 43 98 116 218 72 209 53 13 90 115 211 112 25 81 175 153 223 23 92 36 159 244 140 60 15 61 252 112 170 233 81 163 9 55 93 101 11 163 63 48 61 48 14 6 3 85 29 15 1 1 255 4 4 3 2 5 160 48 29 6 3 85 29 37 4 22 48 20 6 8 43 6 1 5 5 7 3 1 6 8 43 6 1 5 5 7 3 2 48 12 6 3 85 29 19 1 1 255 4 2 48 0 48 10 6 8 42 134 72 206 61 4 3 2 3 104 0 48 101 2 48 96 1 14 9 8 211 37 173 231 253 16 146 4 129 156 30 102 179 102 60 4 28 127 191 185 153 93 92 205 53 253 56 60 127 152 236 49 209 71 55 113 201 250 209 217 190 249 55 2 49 0 202 49 242 29 3 175 187 78 226 28 161 36 54 151 122 61 86 39 142 130 255 225 29 122 160 103 191 166 96 33 135 226 132 56 242 153 248 160 138 84 226 249 39 113 30 234 158 232]] 0x2d04de0 [] [] } 0x2d66460 [] false {0 0} map[]}) &main.apiSrv{addr:”:8443", cert:tls.Certificate{Certificate:[][]uint8{[]uint8{0x30, 0x82, 0x1, 0x9c, 0x30, 0x82, 0x1, 0x22, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x8, 0x79, 0x60, 0xb6, 0xeb, 0xf3, 0xe8, 0xbe, 0x5, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0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0x1, 0xff, 0x4, 0x4, 0x3, 0x2, 0x5, 0xa0, 0x30, 0x1d, 0x6, 0x3, 0x55, 0x1d, 0x25, 0x4, 0x16, 0x30, 0x14, 0x6, 0x8, 0x2b, 0x6, 0x1, 0x5, 0x5, 0x7, 0x3, 0x1, 0x6, 0x8, 0x2b, 0x6, 0x1, 0x5, 0x5, 0x7, 0x3, 0x2, 0x30, 0xc, 0x6, 0x3, 0x55, 0x1d, 0x13, 0x1, 0x1, 0xff, 0x4, 0x2, 0x30, 0x0, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x3, 0x68, 0x0, 0x30, 0x65, 0x2, 0x30, 0x60, 0x1, 0xe, 0x9, 0x8, 0xd3, 0x25, 0xad, 0xe7, 0xfd, 0x10, 0x92, 0x4, 0x81, 0x9c, 0x1e, 0x66, 0xb3, 0x66, 0x3c, 0x4, 0x1c, 0x7f, 0xbf, 0xb9, 0x99, 0x5d, 0x5c, 0xcd, 0x35, 0xfd, 0x38, 0x3c, 0x7f, 0x98, 0xec, 0x31, 0xd1, 0x47, 0x37, 0x71, 0xc9, 0xfa, 0xd1, 0xd9, 0xbe, 0xf9, 0x37, 0x2, 0x31, 0x0, 0xca, 0x31, 0xf2, 0x1d, 0x3, 0xaf, 0xbb, 0x4e, 0xe2, 0x1c, 0xa1, 0x24, 0x36, 0x97, 0x7a, 0x3d, 0x56, 0x27, 0x8e, 0x82, 0xff, 0xe1, 0x1d, 0x7a, 0xa0, 0x67, 0xbf, 0xa6, 0x60, 0x21, 0x87, 0xe2, 0x84, 0x38, 0xf2, 0x99, 0xf8, 0xa0, 0x8a, 0x54, 0xe2, 0xf9, 0x27, 0x71, 0x1e, 0xea, 0x9e, 0xe8}}, PrivateKey:(*ecdsa.PrivateKey)(0x2d04de0), OCSPStaple:[]uint8(nil), SignedCertificateTimestamps:[][]uint8(nil), Leaf:(*x509.Certificate)(nil)}, db:(*main.levelDBStore)(0x2d66460), listener:net.Listener(nil), repl:main.replicationMultiplexer(nil), useHTTP:false, mapsMut:sync.Mutex{state:0, sema:0x0}, misses:map[string]int32{}}} returned unexpectedly", stacktrace: [unknown stack trace] Listen: listen tcp :8443: bind: address already in use Supervisor main: main: Failed service ‘replicationListener(":19200")’ (1.999989 failures of 5.000000), restarting: true, error: “{replicationListener(”:19200") replicationListener(":19200")} returned unexpectedly", stacktrace: [unknown stack trace] Replication listen: listen tcp :19200: bind: address already in use Listen: listen tcp :8443: bind: address already in use

Thanks, Chip

Something else is already listening on port 19200. If that’s another discovery server, maybe investigate that. If it’s something legitimate unrelated, you probably don’t need your discovery server to use replication and can disable it with --replication-listen=""

Interesting… when I run nmap all I see on my rPi is

> PORT     STATE SERVICE
> 22/tcp   open  ssh
> 80/tcp   open  http
> 8443/tcp open  https-alt

This was run immediately upon a fresh reboot… Nonetheless I tried disabling replication with the option you mentioned above and I still get a similar output. I tried running it like so immediately after a reboot, so there should be nothing running on my system at all (except the above ports being used/listened on)…

pi@raspberrypi:/ $ sudo stdiscosrv -cert=cert.pem -key=key.pem --replication-listen="" stdiscosrv v1.8.0 “Fermium Flea” (go1.13.8 linux-arm) deb@build.syncthing.net 2020-08-07 06:09:12 UTC [noupgrade] Server device ID is [ID REMOVED ON PURPOSE BY AUTHOR] Listen: listen tcp :8443: bind: address already in use Listen: listen tcp :8443: bind: address already in use Supervisor main: main: Failed service ‘&main.apiSrv{addr:":8443", cert:tls.Certificate{Certificate:[][]uint8{[]uint8{0x30, 0x82, 0x1, 0x9b, 0x30, 0x82, 0x1, 0x22, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x8, 0x55, 0x6b, 0x97, 0x74, 0x8d, 0x87, 0x26, 0x1e, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x72, 0x76, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x31, 0x30, 0x37, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0xd, 0x34, 0x31, 0x30, 0x37, 0x30, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x72, 0x76, 0x30, 0x76, 0x30, 0x10, 0x6, 0x7, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x2, 0x1, 0x6, 0x5, 0x2b, 0x81, 0x4, 0x0, 0x22, 0x3, 0x62, 0x0, 0x4, 0x9f, 0xc4, 0xc7, 0x22, 0x2c, 0xb4, 0xf8, 0xdf, 0x57, 0x38, 0x95, 0x38, 0xb6, 0xf4, 0xd9, 0xc0, 0xa3, 0xe9, 0x24, 0xda, 0xf5, 0x5b, 0xdc, 0x71, 0x4f, 0xcd, 0x57, 0x23, 0x4, 0xd6, 0x8, 0x1f, 0xe0, 0x68, 0x88, 0x8, 0xde, 0x77, 0xfa, 0x1, 0x45, 0x5d, 0x56, 0x86, 0x89, 0x17, 0xfe, 0xe9, 0xe1, 0x1a, 0xd0, 0x38, 0x5f, 0x64, 0x7d, 0xf3, 0x24, 0x88, 0x8c, 0xd4, 0x60, 0xec, 0x29, 0xb2, 0x96, 0x6b, 0xf4, 0xe8, 0x8f, 0x1c, 0x4c, 0x67, 0xb8, 0x25, 0x82, 0x12, 0x33, 0x68, 0x3c, 0x89, 0x1c, 0x88, 0x31, 0x80, 0xd6, 0x2f, 0x6b, 0x91, 0xf8, 0x92, 0x92, 0x1, 0x2b, 0x36, 0xe3, 0x13, 0xa3, 0x3f, 0x30, 0x3d, 0x30, 0xe, 0x6, 0x3, 0x55, 0x1d, 0xf, 0x1, 0x1, 0xff, 0x4, 0x4, 0x3, 0x2, 0x5, 0xa0, 0x30, 0x1d, 0x6, 0x3, 0x55, 0x1d, 0x25, 0x4, 0x16, 0x30, 0x14, 0x6, 0x8, 0x2b, 0x6, 0x1, 0x5, 0x5, 0x7, 0x3, 0x1, 0x6, 0x8, 0x2b, 0x6, 0x1, 0x5, 0x5, 0x7, 0x3, 0x2, 0x30, 0xc, 0x6, 0x3, 0x55, 0x1d, 0x13, 0x1, 0x1, 0xff, 0x4, 0x2, 0x30, 0x0, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x3, 0x67, 0x0, 0x30, 0x64, 0x2, 0x30, 0x47, 0xb6, 0x25, 0x45, 0xea, 0xc8, 0x82, 0x84, 0xbf, 0xdb, 0xec, 0x68, 0xd5, 0xa7, 0x91, 0x12, 0x38, 0x57, 0xc1, 0x34, 0x28, 0x32, 0xb5, 0xb4, 0x63, 0x48, 0x21, 0xed, 0x1c, 0x6f, 0xea, 0xa9, 0xbc, 0x45, 0x93, 0x1b, 0xc, 0x9a, 0x7f, 0x3b, 0xf2, 0xa0, 0x20, 0x77, 0x59, 0xa, 0xdf, 0x54, 0x2, 0x30, 0x1e, 0xa0, 0x15, 0xc1, 0xc6, 0x75, 0x2e, 0x7d, 0xe7, 0xb, 0x1c, 0x5b, 0xe2, 0x8, 0xb3, 0xc5, 0x3f, 0xdb, 0xc0, 0x26, 0xde, 0xac, 0x4c, 0x8d, 0x23, 0x49, 0xd6, 0x21, 0xbf, 0xa, 0x4d, 0x43, 0x98, 0x28, 0x1, 0x99, 0x96, 0xe7, 0x84, 0x12, 0x62, 0xa1, 0x22, 0xc1, 0xce, 0xe2, 0xe7, 0x66}}, PrivateKey:(*ecdsa.PrivateKey)(0x15ac680), OCSPStaple:[]uint8(nil), SignedCertificateTimestamps:[][]uint8(nil), Leaf:(*x509.Certificate)(nil)}, db:(*main.levelDBStore)(0x14875e0), listener:net.Listener(nil), repl:main.replicationMultiplexer(nil), useHTTP:false, mapsMut:sync.Mutex{state:0, sema:0x0}, misses:map[string]int32{}}’ (1.000000 failures of 5.000000), restarting: true, error: “{%!s(*main.apiSrv=&{:8443 {[[48 130 1 155 48 130 1 34 160 3 2 1 2 2 8 85 107 151 116 141 135 38 30 48 10 6 8 42 134 72 206 61 4 3 2 48 21 49 19 48 17 6 3 85 4 3 19 10 115 116 100 105 115 99 111 115 114 118 48 30 23 13 50 49 48 55 49 50 48 48 48 48 48 48 90 23 13 52 49 48 55 48 55 48 48 48 48 48 48 90 48 21 49 19 48 17 6 3 85 4 3 19 10 115 116 100 105 115 99 111 115 114 118 48 118 48 16 6 7 42 134 72 206 61 2 1 6 5 43 129 4 0 34 3 98 0 4 159 196 199 34 44 180 248 223 87 56 149 56 182 244 217 192 163 233 36 218 245 91 220 113 79 205 87 35 4 214 8 31 224 104 136 8 222 119 250 1 69 93 86 134 137 23 254 233 225 26 208 56 95 100 125 243 36 136 140 212 96 236 41 178 150 107 244 232 143 28 76 103 184 37 130 18 51 104 60 137 28 136 49 128 214 47 107 145 248 146 146 1 43 54 227 19 163 63 48 61 48 14 6 3 85 29 15 1 1 255 4 4 3 2 5 160 48 29 6 3 85 29 37 4 22 48 20 6 8 43 6 1 5 5 7 3 1 6 8 43 6 1 5 5 7 3 2 48 12 6 3 85 29 19 1 1 255 4 2 48 0 48 10 6 8 42 134 72 206 61 4 3 2 3 103 0 48 100 2 48 71 182 37 69 234 200 130 132 191 219 236 104 213 167 145 18 56 87 193 52 40 50 181 180 99 72 33 237 28 111 234 169 188 69 147 27 12 154 127 59 242 160 32 119 89 10 223 84 2 48 30 160 21 193 198 117 46 125 231 11 28 91 226 8 179 197 63 219 192 38 222 172 76 141 35 73 214 33 191 10 77 67 152 40 1 153 150 231 132 18 98 161 34 193 206 226 231 102]] 0x15ac680 [] [] } 0x14875e0 [] false {0 0} map[]}) &main.apiSrv{addr:”:8443", cert:tls.Certificate{Certificate:[][]uint8{[]uint8{0x30, 0x82, 0x1, 0x9b, 0x30, 0x82, 0x1, 0x22, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x8, 0x55, 0x6b, 0x97, 0x74, 0x8d, 0x87, 0x26, 0x1e, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x72, 0x76, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x31, 0x30, 0x37, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0xd, 0x34, 0x31, 0x30, 0x37, 0x30, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0xa, 0x73, 0x74, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x72, 0x76, 0x30, 0x76, 0x30, 0x10, 0x6, 0x7, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x2, 0x1, 0x6, 0x5, 0x2b, 0x81, 0x4, 0x0, 0x22, 0x3, 0x62, 0x0, 0x4, 0x9f, 0xc4, 0xc7, 0x22, 0x2c, 0xb4, 0xf8, 0xdf, 0x57, 0x38, 0x95, 0x38, 0xb6, 0xf4, 0xd9, 0xc0, 0xa3, 0xe9, 0x24, 0xda, 0xf5, 0x5b, 0xdc, 0x71, 0x4f, 0xcd, 0x57, 0x23, 0x4, 0xd6, 0x8, 0x1f, 0xe0, 0x68, 0x88, 0x8, 0xde, 0x77, 0xfa, 0x1, 0x45, 0x5d, 0x56, 0x86, 0x89, 0x17, 0xfe, 0xe9, 0xe1, 0x1a, 0xd0, 0x38, 0x5f, 0x64, 0x7d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, 0xdb, 0xc0, 0x26, 0xde, 0xac, 0x4c, 0x8d, 0x23, 0x49, 0xd6, 0x21, 0xbf, 0xa, 0x4d, 0x43, 0x98, 0x28, 0x1, 0x99, 0x96, 0xe7, 0x84, 0x12, 0x62, 0xa1, 0x22, 0xc1, 0xce, 0xe2, 0xe7, 0x66}}, PrivateKey:(*ecdsa.PrivateKey)(0x15ac680), OCSPStaple:[]uint8(nil), SignedCertificateTimestamps:[][]uint8(nil), Leaf:(*x509.Certificate)(nil)}, db:(*main.levelDBStore)(0x14875e0), listener:net.Listener(nil), repl:main.replicationMultiplexer(nil), useHTTP:false, mapsMut:sync.Mutex{state:0, sema:0x0}, misses:map[string]int32{}}} returned unexpectedly", stacktrace: [unknown stack trace]

So, it seems like the port 8443 being used by https-alt is the problem?

As well, yes, which sounds like the discovery server is already running.

I’m going to wipe this SD card and reinstall the OS. It’s possible I installed and ran something on here previously but I can’t recall. Will let you know the results.

While I’m at it, how would I go about killing the discovery server if this happens again somehow? Is there a proper shutdown command sequence?

Ok. I’ve got a completely fresh install of Raspbian. I did an apt-get update and upgrade initially. Installed nmap and checked the system. Only the SSH port was open on my Pi. Upon execution of “sudo apt-get install syncthing-discosrv” I ran nmap again and it appears that the discovery server is automatically launched upon install? (I see the same “8443/tcp open https-alt” when I run nmap immediately after install) Is this correct behavior? Seems odd but I could be wrong. This port is still open upon startup if I reboot the Pi as well…

Does this mean I do not need to “give the paths to the certificate and key at startup” as explained here: Syncthing Discovery Server — Syncthing v1 documentation ? (I intend to simply use the certs auto-generated by the discovery server)

Assuming this last bit about the certs is true, how do I go about finding the device ID of the discovery server if it has already started without me executing and seeing the printout of its ID? Additionally, how do I stop it from running?

Sorry for all the questions. Perhaps I’m a little thick. I’m hoping the answer to these questions isn’t already out there and I just missed it - I promise I looked

You should check the status of the systemd service that is installed by the apt package:

sudo systemctl status syncthing-discosrv.service

If it’s running, it’s probably the answer to all your questions (if the service is enabled it autostarts, the service has logs, start and stop can be done via the service).

[I think we don’t mention the existence of this service in the docs, probably should fix this if I’m right]

For the record, can you make sure that the process is indeed running, e.g. with top | grep stdiscosrv?

Indeed my output looks like so:

> pi@raspberrypi:~ $ sudo systemctl status syncthing-discosrv.service
> ● stdiscosrv.service - Syncthing Discovery Server
>    Loaded: loaded (/lib/systemd/system/stdiscosrv.service; enabled; vendor preset: enabled)
>    Active: active (running) since Tue 2021-07-13 02:24:20 BST; 37min ago
>      Docs: man:stdiscosrv(1)
>  Main PID: 473 (stdiscosrv)
>     Tasks: 10 (limit: 4915)
>    CGroup: /system.slice/stdiscosrv.service
>            └─473 /usr/bin/stdiscosrv
> 
> Jul 13 02:24:20 raspberrypi systemd[1]: Started Syncthing Discovery Server.
> Jul 13 02:24:21 raspberrypi stdiscosrv[473]: stdiscosrv v1.8.0 "Fermium Flea" (go1.13.8 linux-arm) deb@build.syncthing.net 2020-08-07 06:09:12 UTC [noupgrade]
> Jul 13 02:24:21 raspberrypi stdiscosrv[473]: Server device ID is [OMITTED BY AUTHOR]
> Jul 13 02:27:20 raspberrypi stdiscosrv[473]: http: TLS handshake error from 192.168.1.22:49428: read tcp xxx.xxx.xxx.xxx:8443->xxx.xxx.xxx.xxx:49428: read: connection reset by peer

So, it looks like it’s running - Unsure if that initial error there is something I need to worry about but I will go ahead and try pointing some clients at it.

Thanks for all your help! And yes, maybe just a mention in the instructions page for the more newb types that you must start stop via systemd and that there is not a built in command.

Thanks for all the swift help. You guys are great. Been using SyncThing for a year or so now and it’s great. Just wanted to start getting a little more advanced with it and run my own stuff.

1 Like

Indeed it is running, as confirmed with systemctl and using your “top” suggestion. Thanks for the help!

No, you have been using Syncthing. :wink: (With lower case t.)

Happy syncing!