From 1cd198cf52b3eae677159d81eacca3e0ebe24e71 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Sat, 5 Oct 2013 22:45:08 +0200 Subject: [PATCH 1/2] Flag -f "run in foreground" added as requested by a package maintainter. --- doc/bird.sgml | 3 +++ sysdep/unix/main.c | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 050acf33..2b9ffa02 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -151,6 +151,9 @@ options. The most important ones are: -g use that group ID, see the next section for details. + + -f + run bird in foreground.

BIRD writes messages about its work to log files or syslog (according to config). diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index c7db7c81..165dab2b 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -601,16 +601,17 @@ signal_init(void) * Parsing of command-line arguments */ -static char *opt_list = "c:dD:ps:P:u:g:"; +static char *opt_list = "c:dD:ps:P:u:g:f"; static int parse_and_exit; char *bird_name; static char *use_user; static char *use_group; +static int run_in_foreground = 0; static void usage(void) { - fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-P ] [-u ] [-g ]\n", bird_name); + fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-P ] [-u ] [-g ] [-f]\n", bird_name); exit(1); } @@ -718,6 +719,9 @@ parse_args(int argc, char **argv) case 'g': use_group = optarg; break; + case 'f': + run_in_foreground = 1; + break; default: usage(); } @@ -777,7 +781,7 @@ main(int argc, char **argv) if (parse_and_exit) exit(0); - if (!debug_flag) + if (!(debug_flag||run_in_foreground)) { pid_t pid = fork(); if (pid < 0) From f8cc7396cf25328b002394bbd7af679188b03370 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 15 Oct 2013 10:57:57 +0200 Subject: [PATCH 2/2] Forces KRT rescan on syncer startup with multi syncer config. Thanks to Sergey Popovich for the patch. --- sysdep/unix/krt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 6de6077e..57cfe5a4 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -846,12 +846,11 @@ static void krt_scan_timer_start(struct krt_proto *p) { if (!krt_scan_count) - { krt_scan_timer = tm_new_set(krt_pool, krt_scan, NULL, 0, KRT_CF->scan_time); - tm_start(krt_scan_timer, 0); - } krt_scan_count++; + + tm_start(krt_scan_timer, 0); } static void