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/daemonsand set the following as a wrap command for the daemons you want:/usr/bin/daemonize /usr/bin/rr record -wDaemons are started with
-d, which causes them to fork and the parent process to exit. The-woption torrmakes sure thatrrfollows child processes; without it,rrwill exit with the parent and the recording will contain only the startup sequence for the daemon prior to its call tofork(). However,-wmeans that rr will stay in the foreground while following the child process, which is whydaemonizeis needed;daemonizebackgroundsrr, 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=-1Because 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 inwatchfrrbeing run withrrwhich causes it to block forever, for some reason.