chiark / gitweb /
virtualization: beef virtualization code
[elogind.git] / src / main.c
index 8512e0b1d4e1ed1a5604f9135f8f8f437dbc1b35..d1be83d44f9eb774025e5c8ccf18e7dc23eb8dbd 100644 (file)
@@ -73,7 +73,7 @@ static bool arg_sysv_console = true;
 static bool arg_mount_auto = true;
 static bool arg_swap_auto = true;
 static char **arg_default_controllers = NULL;
-static ExecOutput arg_default_std_output = EXEC_OUTPUT_NULL;
+static ExecOutput arg_default_std_output = EXEC_OUTPUT_INHERIT;
 static ExecOutput arg_default_std_error = EXEC_OUTPUT_INHERIT;
 
 static FILE* serialization = NULL;
@@ -1012,6 +1012,11 @@ int main(int argc, char *argv[]) {
         if (parse_argv(argc, argv) < 0)
                 goto finish;
 
+        if (arg_action == ACTION_TEST && geteuid() == 0) {
+                log_error("Don't run test mode as root.");
+                goto finish;
+        }
+
         /* If Plymouth is being run make sure we show the status, so
          * that there's something nice to see when people press Esc */
         if (access("/dev/.systemd/plymouth", F_OK) >= 0)