if (getpid() == 1) {
arg_running_as = MANAGER_SYSTEM;
- log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_JOURNAL_OR_KMSG);
+ log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_JOURNAL : LOG_TARGET_JOURNAL_OR_KMSG);
if (!is_reexec) {
if (selinux_setup(&loaded_policy) < 0)
log_open();
- if (label_init() < 0)
+ if (label_init(NULL) < 0)
goto finish;
if (!is_reexec)
unsetenv("SHLVL");
unsetenv("_");
+ /* When we are invoked by a tool chroot-like such as
+ * nspawn, these might be set, but make little sense
+ * to pass on */
+ unsetenv("USER");
+ unsetenv("LOGNAME");
+
/* All other variables are left as is, so that clients
* can still read them via /proc/1/environ */
}