};
DEFINE_STRING_TABLE_LOOKUP(cgroup_controller, CGroupController);
-
-int cg_check_cgroup_exist(const char *p) {
- const char *cc;
- assert(p);
-
- cc = strjoina("/sys/fs/cgroup/systemd", p);
- if (laccess(cc, F_OK) < 0) {
- return -errno;
- }
-
- return 0;
-}
int cg_pid_get_path(const char *controller, pid_t pid, char **path);
-int cg_check_cgroup_exist(const char *p);
-
int cg_trim(const char *controller, const char *path, bool delete_root);
int cg_rmdir(const char *controller, const char *path);
assert(c);
assert(_pid);
- /* TODO workaround code */
- if (UNIT(s)->cgroup_realized) {
- _cleanup_free_ char *path_temp = NULL;
- path_temp = unit_default_cgroup_path(UNIT(s));
-
- if (cg_check_cgroup_exist(path_temp) < 0) {
- log_unit_error(UNIT(s), "CGROUP ERROR! (%s) is already realized but not exists", UNIT(s)->id);
- UNIT(s)->cgroup_realized = false;
- UNIT(s)->cgroup_realized_mask = 0;
- }
- }
-
(void) unit_realize_cgroup(UNIT(s));
if (s->reset_cpu_usage) {
(void) unit_reset_cpu_usage(UNIT(s));