cloudflare / gortr

The RPKI-to-Router server used at Cloudflare
https://rpki.cloudflare.com
BSD 3-Clause "New" or "Revised" License
309 stars 39 forks source link

./gortr: No such file or directory #13

Closed liuxyon closed 5 years ago

liuxyon commented 5 years ago

i am new use it, How i do fix it? where are codes folder?

root@changeme:~# ./gortr -bind 127.0.0.1:8282 -bash: ./gortr: No such file or directory

lspgn commented 5 years ago

Hi @liuxyon, If you ran a go get, you should find the compiled software in the $GOPATH/bin directory (by default ~/go/bin)

liuxyon commented 5 years ago

get it in root folder. how run it in auto service ? how i change and config Data sources?

Where does the default data source come from? root@changeme:/etc/gortr/bin# ./gortr -bind 127.0.0.1:8282 INFO[0001] New update (74178 uniques, 74178 total prefixes). 0 bytes. Updating sha256 hash -> 4dbe496b2f0a5b8ac2f074913e605ca99c640ead915fff92ae399ac599c8f INFO[0001] Updated added, new serial 1

lspgn commented 5 years ago

You can find the arguments of the CLI: ./gortr -h. The default data source is: https://rpki.cloudflare.com/rpki.json. If you're using a custom data source, ./gortr -cache https://your-data-source/roas.json -verify=false. The verify flag is necessary unless the data source contains cryptographic signatures.

To run it as a service, it will depend on your Linux distribution. You may need to create a script in /etc/init.d/ or a systemd service. For the second case, you can take this file from Arch AUR as an example.

liuxyon commented 5 years ago

How to automatically run in the background after entering the command to run when i input ctrl+c , it is stop run.

i am using ubuntu 18.0.4.2 system.

Is it possible to configure to acquire different data sources at the same time or to obtain different data sources according to conditions?

root@changeme:/etc/gortr/bin# ./gortr -bind 127.0.0.1:8282 INFO[0001] New update (74571 uniques, 74571 total prefixes). 0 bytes. Updating sha256 hash -> c11bb95091898b13268723341a52b1730c1c9aa0479687b3900 INFO[0001] Updated added, new serial 1 ^C root@changeme:/etc/gortr/bin#

lspgn commented 5 years ago

To run in the background, you have to do:

$ gortr your_args & (must be ended by ampersand)

Or Ctrl+Z then type bg.

liuxyon commented 5 years ago

root@changeme:/etc/gortr/bin# INFO[0084] Accepted connection from 198.199.98.246:34525 (1/0) INFO[0094] Accepted connection from 198.199.98.246:34560 (1/0)

Each time there is a connection, the log will be displayed on the display, how to hide or set whether to display, and how to record in the log file.There should be control of the number of duplicate records.

lspgn commented 5 years ago

use argument: '-loglevel warn` to reduce the logging.

liuxyon commented 5 years ago

What is the reason for this? ERRO[17399] Error updating: Identical files

lspgn commented 5 years ago

I should remove this as an error. It tries to refresh the file regularly but in this case, it was the same file so it is not sending any update to the router or computing a diff.

liuxyon commented 5 years ago

how stop this running?

/etc/gortr/bin# ./gortr stop FATA[0000] listen tcp :8080: bind: address already in use root@changeme:/etc/gortr/bin# ./gortr -loglevel warn FATA[0000] listen tcp :8080: bind: address already in use

what is metrics? what is need me config? i have no find the /metrics metrics.path string Metrics path (default "/metrics")

lspgn commented 5 years ago

gortr is a foreground program. It is probably started as a daemon if you used the systemctl config file.

systemctl stop gortr may work. Or find the pid using ps | grep gortr and kill -5 PID. If gortr is not running: just use a different port: -metrics.addr :8081. Use netstat -tulpn | grep 8080 to figure out which program bound on :8080.

The http port is displaying metrics in order to monitor RTR distribution: http://localhost:8080/metrics

liuxyon commented 5 years ago

i am your said command To run in the background, you have to do: $ gortr your_args & (must be ended by ampersand) ps | grep gortr 13252 pts/0 00:26:16 gortr

if i want to stop it, it is should command?

liuxyon commented 5 years ago

`root@changeme:/# ps | grep gortr 13252 pts/0 00:26:16 gortr root@changeme:/# kill -5 13252 root@changeme:/# SIGTRAP: trace trap PC=0x45b5d3 m=0 sigcode=0

goroutine 22 [syscall, 8 minutes]: runtime.notetsleepg(0xbd18c0, 0x8bb2c8f120, 0x1) /usr/local/go/src/runtime/lock_futex.go:227 +0x37 fp=0xc000041f58 sp=0xc000041f28 pc=0x40c347 runtime.timerproc(0xbd18a0) /usr/local/go/src/runtime/time.go:288 +0x30e fp=0xc000041fd8 sp=0xc000041f58 pc=0x44ad2e runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc000041fe0 sp=0xc000041fd8 pc=0x459781 created by runtime.(*timersBucket).addtimerLocked /usr/local/go/src/runtime/time.go:170 +0x114

goroutine 1 [chan receive, 8 minutes]: main.(*state).routineUpdate(0xc00280dd90, 0x883fe2, 0x25, 0x258) /root/go/src/github.com/cloudflare/gortr/cmd/gortr/gortr.go:262 +0x114 main.main() /root/go/src/github.com/cloudflare/gortr/cmd/gortr/gortr.go:407 +0x31b

goroutine 9 [IO wait, 374 minutes]: internal/poll.runtime_pollWait(0x7fa12617bf00, 0x72, 0x0) /usr/local/go/src/runtime/netpoll.go:173 +0x66 internal/poll.(pollDesc).wait(0xc000114118, 0x72, 0xc00009e000, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9a internal/poll.(pollDesc).waitRead(0xc000114118, 0xffffffffffffff00, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d internal/poll.(FD).Accept(0xc000114100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_unix.go:384 +0x1a0 net.(netFD).accept(0xc000114100, 0xc000044a80, 0x30, 0x30) /usr/local/go/src/net/fd_unix.go:238 +0x42 net.(TCPListener).accept(0xc00009a0b0, 0x50, 0x7fa1261d76c0, 0x0) /usr/local/go/src/net/tcpsock_posix.go:139 +0x2e net.(TCPListener).AcceptTCP(0xc00009a0b0, 0x40dba8, 0x30, 0x840bc0) /usr/local/go/src/net/tcpsock.go:247 +0x47 net/http.tcpKeepAliveListener.Accept(0xc00009a0b0, 0x840bc0, 0xc000085980, 0x7f9b20, 0xbc0bb0) /usr/local/go/src/net/http/server.go:3232 +0x2f net/http.(Server).Serve(0xc00008ef70, 0x8e9120, 0xc00009a0b0, 0x0, 0x0) /usr/local/go/src/net/http/server.go:2826 +0x22f net/http.(Server).ListenAndServe(0xc00008ef70, 0xc00008ef70, 0xc000085830) /usr/local/go/src/net/http/server.go:2764 +0xb6 net/http.ListenAndServe(0x87696c, 0x5, 0x0, 0x0, 0x8923e8, 0x0) /usr/local/go/src/net/http/server.go:3004 +0x74 main.metricHTTP() /root/go/src/github.com/cloudflare/gortr/cmd/gortr/gortr.go:93 +0x79 created by main.main /root/go/src/github.com/cloudflare/gortr/cmd/gortr/gortr.go:356 +0x706

goroutine 10 [IO wait, 369 minutes]: internal/poll.runtime_pollWait(0x7fa12617be30, 0x72, 0x0) /usr/local/go/src/runtime/netpoll.go:173 +0x66 internal/poll.(pollDesc).wait(0xc000114198, 0x72, 0xc00009e400, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9a internal/poll.(pollDesc).waitRead(0xc000114198, 0xffffffffffffff00, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d internal/poll.(FD).Accept(0xc000114180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_unix.go:384 +0x1a0 net.(netFD).accept(0xc000114180, 0x0, 0x1, 0xc00009c2a0) /usr/local/go/src/net/fd_unix.go:238 +0x42 net.(TCPListener).accept(0xc00009a0c0, 0xc0000d1eb8, 0xc0000d1ec0, 0x8) /usr/local/go/src/net/tcpsock_posix.go:139 +0x2e net.(TCPListener).Accept(0xc00009a0c0, 0x8913e0, 0xc00009c300, 0x3, 0x3) /usr/local/go/src/net/tcpsock.go:260 +0x47 github.com/cloudflare/gortr/lib.(Server).loopTCP(0xc00013e000, 0x8e8ae0, 0xc00009a0c0) /root/go/src/github.com/cloudflare/gortr/lib/server.go:476 +0x49 github.com/cloudflare/gortr/lib.(Server).Start(0xc00013e000, 0x7ffe908517b7, 0x11) /root/go/src/github.com/cloudflare/gortr/lib/server.go:471 +0xce created by main.main /root/go/src/github.com/cloudflare/gortr/cmd/gortr/gortr.go:390 +0x55c

rax 0xfffffffffffffffc rbx 0x3b9a4b20 rcx 0x45b5d3 rdx 0x0 rdi 0xbd18c0 rsi 0x80 rbp 0xc000041ee0 rsp 0xc000041e98 r8 0x0 r9 0x0 r10 0xc000041ed0 r11 0x202 r12 0xa r13 0x32 r14 0x8df308 r15 0x0 rip 0x45b5d3 rflags 0x202 cs 0x33 fs 0x0 gs 0x0 `

lspgn commented 5 years ago

When you start a command with ampersand &, it will return the PID. You have to save it. This is why I advise you to use an init/systemd service file which will do these operations for you.

For the second, I will take a look. program may have been killed while it was doing an operation.