log_close();
}
}
+
execve(command->path, final_argv, final_env);
*exit_status = EXIT_EXEC;
return -errno;
* sure that when we kill the cgroup the process will be
* killed too). */
if (params->cgroup_path)
- cg_attach(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, pid);
+ (void) cg_attach(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, pid);
exec_status_start(&command->exec_status, pid);
if (s->state == SCOPE_FAILED)
return -EPERM;
+ /* We can't fulfill this right now, please try again later */
if (s->state == SCOPE_STOP_SIGTERM ||
s->state == SCOPE_STOP_SIGKILL)
return -EAGAIN;
(void) unit_reset_cpu_usage(u);
r = unit_attach_pids_to_cgroup(u);
- if (r < 0)
+ if (r < 0) {
+ log_unit_warning_errno(UNIT(s)->id, r, "%s: Failed to add PIDs to scope's control group: %m", UNIT(s)->id);
+ scope_enter_dead(s, SERVICE_FAILURE_RESOURCES);
return r;
+ }
s->result = SCOPE_SUCCESS;