summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-07-08 15:05:24 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-09 17:36:08 +0200
commit9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a (patch)
tree05da2bdd23b7c8834338a7d72ce5b302c46bc386 /src/monitor
parent842f83f8db513214241a0fea076ac160b180e1dd (diff)
downloadsssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.gz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.xz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.zip
SSSD: Send debug to stderr when running on foreground
https://fedorahosted.org/sssd/ticket/2348 When SSSD is running in interactive mode, we should print DEBUG messages directly to stderr, not journal. Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 5feba706a..39f4e6437 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1124,6 +1124,14 @@ static int get_service_config(struct mt_ctx *ctx, const char *name,
talloc_free(svc);
return ENOMEM;
}
+ } else if (ctx->is_daemon == false) {
+ svc->command = talloc_strdup_append(
+ svc->command, " --debug-to-stderr"
+ );
+ if (!svc->command) {
+ talloc_free(svc);
+ return ENOMEM;
+ }
}
}
@@ -1287,6 +1295,14 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name,
talloc_free(svc);
return ENOMEM;
}
+ } else if (ctx->is_daemon == false) {
+ svc->command = talloc_strdup_append(
+ svc->command, " --debug-to-stderr"
+ );
+ if (!svc->command) {
+ talloc_free(svc);
+ return ENOMEM;
+ }
}
}
@@ -2735,7 +2751,10 @@ int main(int argc, const char *argv[])
}
if (opt_daemon) flags |= FLAGS_DAEMON;
- if (opt_interactive) flags |= FLAGS_INTERACTIVE;
+ if (opt_interactive) {
+ flags |= FLAGS_INTERACTIVE;
+ debug_to_stderr = 1;
+ }
if (opt_config_file) {
config_file = talloc_strdup(tmp_ctx, opt_config_file);