chiark / gitweb /
core/execute.c: debug log final execve() with argv[]
[elogind.git] / src / core / execute.c
index dddef145140fcb7949c01c951e323c4adad27fb6..ab508b16186dcc9b036591c8bcb2392296ef6c30 100644 (file)
@@ -1516,6 +1516,20 @@ int exec_spawn(ExecCommand *command,
 
                 final_env = strv_env_clean(final_env);
 
+                if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) {
+                        line = exec_command_line(final_argv);
+                        if (line) {
+                                log_open();
+                                log_struct_unit(LOG_DEBUG,
+                                                unit_id,
+                                                "EXECUTABLE=%s", command->path,
+                                                "MESSAGE=Executing: %s",
+                                                line, NULL);
+                                log_close();
+                                free(line);
+                                line = NULL;
+                        }
+                }
                 execve(command->path, final_argv, final_env);
                 err = -errno;
                 r = EXIT_EXEC;
@@ -1547,8 +1561,7 @@ int exec_spawn(ExecCommand *command,
          * outside of the cgroup) and in the parent (so that we can be
          * sure that when we kill the cgroup the process will be
          * killed too). */
-        if (cgroup_bondings)
-                cgroup_bonding_install_list(cgroup_bondings, pid, cgroup_suffix);
+        cgroup_bonding_install_list(cgroup_bondings, pid, cgroup_suffix);
 
         exec_status_start(&command->exec_status, pid);