Skip to content

Commit 4c81ac9

Browse files
committed
confd: adjust Frr logging for staticd and ospfd
Ensure Frr logs to the local2 syslog facility to allow sorting all Frr (staticd, ospfd) logs into a dedicated /var/log/routing log file. We activate OSPF debugging, but keep log level at 'informational' for the time being. The YANG model needs some sort of "knob" to toggle debug messages when troubleshooting OSPF. Fixes #541 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 8cafd6f commit 4c81ac9

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

board/common/rootfs/etc/syslog.d/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Reserved facilities for logging in various subsystems:
22

33
- local0: rauc
44
- local1: containers
5-
- local2:
5+
- local2: routing (frr)
66
- local3:
77
- local5:
88
- local6: reserved
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local2.* -/var/log/routing
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d /var/run/frr 0755 frr frr -

src/confd/src/ietf-routing.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
#define BFDD_CONF "/etc/frr/bfd_enabled" /* Just signal that bfd should be enabled*/
1818
#define BFDD_CONF_NEXT BFDD_CONF "+"
1919

20-
#define FRR_STATIC_CONFIG "! Generated by Infix\n\
20+
#define FRR_STATIC_CONFIG "! Generated by Infix confd\n\
2121
frr defaults traditional\n\
2222
hostname Router\n\
2323
password zebra \n\
2424
enable password zebra\n\
25-
log syslog informational\n"
25+
no log unique-id\n\
26+
log syslog informational\n\
27+
log facility local2\n"
2628

2729
int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FILE *fp)
2830
{
@@ -126,6 +128,14 @@ int parse_ospf_areas(sr_session_ctx_t *session, struct lyd_node *areas, FILE *fp
126128

127129
int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
128130
{
131+
const char *static_debug = "! OSPF default debug\
132+
debug ospf bfd\n \
133+
debug ospf packet all detail\n \
134+
debug ospf ism\n \
135+
debug ospf nsm\n \
136+
debug ospf default-information\n \
137+
debug ospf nssa\n\
138+
! OSPF configuration\n";
129139
struct lyd_node *areas, *default_route;
130140
const char *router_id;
131141
int bfd_enabled = 0;
@@ -139,6 +149,8 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
139149
}
140150

141151
fputs(FRR_STATIC_CONFIG, fp);
152+
fputs(static_debug, fp);
153+
142154
areas = lydx_get_child(ospf, "areas");
143155
router_id = lydx_get_cattr(ospf, "explicit-router-id");
144156
bfd_enabled = parse_ospf_interfaces(session, areas, fp);

0 commit comments

Comments
 (0)