aboutsummaryrefslogtreecommitdiff
path: root/lib/daemon.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-14 16:08:59 -0700
committerBen Pfaff <blp@nicira.com>2011-06-16 12:28:06 -0700
commitd3824212ada08ae285ac2e4f05dc30d97a7c25ad (patch)
tree66da0ad5ebd7fd8d045e7a9bfb16f6618155a442 /lib/daemon.c
parentbae473fea5404a5afd205c70689778386045ebab (diff)
daemon: Disable logging to console after detaching.
When we detach, we replace stderr by /dev/null, so there's no point in logging to the console after that. Just turn it off.
Diffstat (limited to 'lib/daemon.c')
-rw-r--r--lib/daemon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/daemon.c b/lib/daemon.c
index 9c814ea9..f4151ab1 100644
--- a/lib/daemon.c
+++ b/lib/daemon.c
@@ -408,6 +408,9 @@ close_standard_fds(void)
dup2(null_fd, STDOUT_FILENO);
dup2(null_fd, STDERR_FILENO);
}
+
+ /* Disable logging to stderr to avoid wasting CPU time. */
+ vlog_set_levels(NULL, VLF_CONSOLE, VLL_EMER);
}
/* If daemonization is configured, then starts daemonization, by forking and