FRRouting / gentoo-overlay

FRR Gentoo Overlay
5 stars 7 forks source link

The ebuild doesn’t install correctly the init scripts #53

Closed alarig closed 4 years ago

alarig commented 4 years ago

All the scripts are linked to zebra, but zebra is linked to itself:

rr2 ~ # file /etc/init.d/ospfd
/etc/init.d/ospfd: broken symbolic link to zebra
rr2 ~ # file /etc/init.d/bgpd 
/etc/init.d/bgpd: broken symbolic link to zebra
rr2 ~ # file /etc/init.d/zebra 
/etc/init.d/zebra: broken symbolic link to zebra
alarig commented 4 years ago

Also, zebra can’t start in background:

rr2 ~ # /usr/sbin/zebra -d -f /etc/frr/zebra.conf --pid_file /run/frr/zebra.pid
2020/03/22 16:05:54 warnings: ZEBRA: [EC 4043309105] Disabling MPLS support (no kernel support)
==3986==LeakSanitizer has encountered a fatal error.
==3986==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==3986==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

But the foreground mode works:

rr2 ~ # /usr/sbin/zebra -f /etc/frr/zebra.conf 
2020/03/22 16:06:11 warnings: ZEBRA: [EC 4043309105] Disabling MPLS support (no kernel support)
^Crr2 ~ # 
rr2 ~ # 

So I added another commit to let start-stop-daemon managing the background mode.

Daemons want to write their own PID file, even if --pid_file isn’t specified in the command line… So I changed the ${pidfile} variable to make start-stop-daemon writing in a different file than the started daemon. Both files have exactly the same content, so it’s very ugly, but necessary.

rr2 ~ # cat /run/frr-bgpd.pid                                                             
9525                                                                                      
rr2 ~ # cat /run/frr/bgpd.pid                
9525                                                                                      
rzalamena commented 4 years ago

Like I commented in PR #54 , maybe we should migrate to watchfrr and let it handle the pids of all daemons. Its a bit redundant with OpenRC, however watchfrr guarantees start order and restart daemons in correct order if something crashes.

It is also possible that sometime in future watchfrr do more than just (re)starting the daemons.