Revert "core: fix the CGROUP spawning error as a workaround"
authorINSUN PYO <insun.pyo@samsung.com>
Tue, 16 Apr 2019 04:25:07 +0000 (13:25 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 12 Feb 2024 15:37:44 +0000 (16:37 +0100)
This reverts commit adce88455e758166ad4f2103724cd34c11c5f141.

Change-Id: Ie76d6183f8f5966fa9187666a5777c1c50926353

src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/core/service.c

index 91fa96a..3fad559 100644 (file)
@@ -2366,15 +2366,3 @@ static const char *cgroup_controller_table[_CGROUP_CONTROLLER_MAX] = {
 };
 
 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;
-}
index 11f1d07..14ebde5 100644 (file)
@@ -158,8 +158,6 @@ int cg_get_path_and_check(const char *controller, const char *path, const char *
 
 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);
index c97b575..a6e1a39 100644 (file)
@@ -1176,18 +1176,6 @@ static int service_spawn(
         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));