Useful to help debug intermittent FRR issues, or problems which only reproduce under certain network conditions that are difficult to recreate.
-
Install daemonize
-
Edit
/etc/frr/daemons
and set the following as a wrap command for the daemons you want:/usr/bin/daemonize /usr/bin/rr record -w
Daemons are started with
-d
, which causes them to fork and the parent process to exit. The-w
option torr
makes sure thatrr
follows child processes; without it,rr
will exit with the parent and the recording will contain only the startup sequence for the daemon prior to its call tofork()
. However,-w
means that rr will stay in the foreground while following the child process, which is whydaemonize
is needed;daemonize
backgroundsrr
, which allows the init script to continue.Example wrap:
bgpd_wrap="/usr/bin/daemonize /usr/bin/rr record -w"
-
Allow unprivileged users to use perf events by setting this sysctl:
sysctl -w kernel.perf_event_paranoid=-1
Because FRR drops privileges, if you don't set this sysctl it will crash after dropping privs when run under
rr
. -
Restart FRR.
Notes:
- Don't use
all_wrap
. This will result inwatchfrr
being run withrr
which causes it to block forever, for some reason.