Disable remount memory cgroup and no malort creation if no memory cgroup accepted/tizen/unified/20210923.012103 submit/tizen/20210916.083705
authorKunhoon Baik <knhoon.baik@samsung.com>
Thu, 16 Sep 2021 08:20:41 +0000 (17:20 +0900)
committerKunhoon Baik <knhoon.baik@samsung.com>
Thu, 16 Sep 2021 08:20:41 +0000 (17:20 +0900)
If memory cgroup does not existed,
 - we will not try to create memory cgroup or remount memory cgroup.
 - malort will not setup memory cgroup

packaging/nsjail.sh

index a74456e29d79547267d62bacf2bf5c2336640ad2..c3d26ca9c2589e07e3104b5e265f8d4f24184ccd 100644 (file)
@@ -5,14 +5,10 @@ OWNER_ID=`id -u owner`
 
 if [ x$1 == "xstart" ]
 then
-       while [ ! -d "/sys/fs/cgroup/memory" ]
-       do
-               /usr/bin/cgroup_remount
-               sleep 1;
-       done
-
-       mkdir /sys/fs/cgroup/memory/malort
-       chown -R owner:users /sys/fs/cgroup/memory/malort
+       if [ -d "/sys/fs/cgroup/memory" ]; then
+               mkdir /sys/fs/cgroup/memory/malort
+               chown -R owner:users /sys/fs/cgroup/memory/malort
+       fi
 
        mkdir /sys/fs/cgroup/cpu/malort
        chown -R owner:users /sys/fs/cgroup/cpu/malort