summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-10 13:14:56 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-10 13:14:56 +0200
commit2f6f1bc30c528ca7346b4c93f08b65682aa2876f (patch)
tree0080683660ed839c395cb52050a99d8ca5db5645 /src/core/main.c
parent7762e02b172913e8af82f6ba013487527413be84 (diff)
selinux: close stdin/stdout/stderr before loading selinux policy
Let's make sure libselinux doesn't spew to stderr
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 33c0692c71..458fdca55e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1266,6 +1266,8 @@ int main(int argc, char *argv[]) {
}
arg_running_as = MANAGER_SYSTEM;
+
+ make_null_stdio();
log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_JOURNAL : LOG_TARGET_JOURNAL_OR_KMSG);
if (!skip_setup) {
@@ -1439,10 +1441,8 @@ int main(int argc, char *argv[]) {
/* Reset the console, but only if this is really init and we
* are freshly booted */
- if (arg_running_as == MANAGER_SYSTEM && arg_action == ACTION_RUN) {
+ if (arg_running_as == MANAGER_SYSTEM && arg_action == ACTION_RUN)
console_setup(getpid() == 1 && !skip_setup);
- make_null_stdio();
- }
/* Open the logging devices, if possible and necessary */
log_open();