chiark / gitweb /
util: split-out hwclock.[ch]
[elogind.git] / src / core / main.c
index 9db83aa2e534c73c39db002a6121c2ca5ec08cf6..fe4522e9a09ad33c12053cb1a313717135faafc3 100644 (file)
@@ -54,6 +54,7 @@
 #include "hostname-setup.h"
 #include "machine-id-setup.h"
 #include "locale-setup.h"
+#include "hwclock.h"
 #include "selinux-setup.h"
 #include "ima-setup.h"
 
@@ -76,8 +77,6 @@ static bool arg_show_status = true;
 #ifdef HAVE_SYSV_COMPAT
 static bool arg_sysv_console = true;
 #endif
-static bool arg_mount_auto = true;
-static bool arg_swap_auto = true;
 static char **arg_default_controllers = NULL;
 static char ***arg_join_controllers = NULL;
 static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL;
@@ -658,8 +657,6 @@ static int parse_config_file(void) {
 #endif
                 { "Manager", "CrashChVT",             config_parse_int,          0, &arg_crash_chvt          },
                 { "Manager", "CPUAffinity",           config_parse_cpu_affinity2, 0, NULL                    },
-                { "Manager", "MountAuto",             config_parse_bool,         0, &arg_mount_auto          },
-                { "Manager", "SwapAuto",              config_parse_bool,         0, &arg_swap_auto           },
                 { "Manager", "DefaultControllers",    config_parse_strv,         0, &arg_default_controllers },
                 { "Manager", "DefaultStandardOutput", config_parse_output,       0, &arg_default_std_output  },
                 { "Manager", "DefaultStandardError",  config_parse_output,       0, &arg_default_std_error   },
@@ -1211,7 +1208,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_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)
@@ -1222,7 +1219,7 @@ int main(int argc, char *argv[]) {
 
                 log_open();
 
-                if (label_init() < 0)
+                if (label_init(NULL) < 0)
                         goto finish;
 
                 if (!is_reexec)
@@ -1350,6 +1347,12 @@ int main(int argc, char *argv[]) {
                 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 */
         }
@@ -1421,8 +1424,6 @@ int main(int argc, char *argv[]) {
 #ifdef HAVE_SYSV_COMPAT
         m->sysv_console = arg_sysv_console;
 #endif
-        m->mount_auto = arg_mount_auto;
-        m->swap_auto = arg_swap_auto;
         m->default_std_output = arg_default_std_output;
         m->default_std_error = arg_default_std_error;
         m->runtime_watchdog = arg_runtime_watchdog;