pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hlr/+/42018?usp=email )
Change subject: osmo-hlr: Force log stderr blocking-io in --db-check mode ......................................................................
osmo-hlr: Force log stderr blocking-io in --db-check mode
When --db-check is used, osmo-hlr actually becomes a synchronous non-interactive program instead of a daemon. In that case, we want to use blocking-io since it doesn't use the event loop, so we want to flush all logging synchronously before exiting.
Usually the user will pass the same osmo-hlr.cfg when running with --db-check, which means most probably won't be using blocking-io (as expected when osmo-hlr runs in daemon mode). Since --db-check converts osmo-hlr to a cmdline which exits after checks are done, we actually want to force blocking-io in that case, so that all content is written to stderr before finishing the process.
Change-Id: If5e505383086cc55d724c0d6891756c8d94fa267 --- M src/hlr.c 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/18/42018/1
diff --git a/src/hlr.c b/src/hlr.c index 0cfa09a..038a0a4 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -809,6 +809,11 @@ return rc; }
+ if (cmdline_opts.db_check) { + /* Make sure to use synchronous logging to stderr in --db-check (non-interactive mode): */ + log_target_file_switch_to_stream(osmo_stderr_target); + } + LOGP(DMAIN, LOGL_NOTICE, "hlr starting\n");
rc = rand_init();