summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-25 21:22:57 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-25 21:22:57 +0200
commit871e580949b1417058da7f7e9fa0380d308ef708 (patch)
treecd8d308e7ab3c81c42259b3ed2a636334be9b367 /src/main.c
parent41e4d6e9ace4f3b717af3c0419b69a2ac7935116 (diff)
selinux: log how much time it takes to load the SELinux policy and database
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 0a99e5a916..b181447ca3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1046,6 +1046,7 @@ int main(int argc, char *argv[]) {
if (getpid() == 1) {
arg_running_as = MANAGER_SYSTEM;
log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_SYSLOG_OR_KMSG);
+ log_open();
/* This might actually not return, but cause a
* reexecution */
@@ -1064,9 +1065,11 @@ int main(int argc, char *argv[]) {
else
log_info("RTC configured in localtime, applying delta of %i minutes to system time.", min);
}
+
} else {
arg_running_as = MANAGER_USER;
log_set_target(LOG_TARGET_AUTO);
+ log_open();
}
if (set_default_unit(SPECIAL_DEFAULT_TARGET) < 0)
@@ -1122,6 +1125,9 @@ int main(int argc, char *argv[]) {
assert_se(arg_action == ACTION_RUN || arg_action == ACTION_TEST);
+ /* Close logging fds, in order not to confuse fdset below */
+ log_close();
+
/* Remember open file descriptors for later deserialization */
if (serialization) {
if ((r = fdset_new_fill(&fds)) < 0) {