}
r = cg_attach_everywhere(params->cgroup_supported, p, 0, NULL, NULL);
+ if (r == -EUCLEAN) {
+ *exit_status = EXIT_CGROUP;
+ return log_unit_error_errno(unit, r, "Failed to attach process to cgroup %s "
+ "because the cgroup or one of its parents or "
+ "siblings is in the threaded mode: %m", p);
+ }
if (r < 0) {
*exit_status = EXIT_CGROUP;
return log_unit_error_errno(unit, r, "Failed to attach to cgroup %s: %m", p);
xsprintf(c, PID_FMT "\n", pid);
r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
+ if (r == -EOPNOTSUPP && cg_is_threaded(controller, path) > 0)
+ /* When the threaded mode is used, we cannot read/write the file. Let's return recognizable error. */
+ return -EUCLEAN;
if (r < 0)
return r;