Linux Cgroup writing to control files, working for CPU but not Device subsystem?











up vote
1
down vote

favorite












I'm trying to setup Cgroups for a non-root user glassfish.



System setup:




  • CentOS 7.2.1511

  • Kernel 3.10.0-327.el7.x86_64

  • Cgroup mounted at /sys/fs/cgroup


It should be possible to create a Cgroup for non-root user by issuing these commands:





  1. For CPU subsystem:



    $ sudo mkdir /sys/fs/cgroup/cpu/${USER}
    $ sudo chown -R ${USER} /sys/fs/cgroup/cpu/${USER}



  2. For Devices subsystem:



    $ sudo mkdir /sys/fs/cgroup/devices/${USER}
    $ sudo chown -R ${USER} /sys/fs/cgroup/devices/${USER}



This works for the CPU subsystem. Since I am able to write to control files as glassfish, such as cpu.cfs_period_us like below



    echo 43434 > cpu.cfs_period_us


But writing to the Devices subsystem such as



    echo 'a *:* rwm' > devices.deny


Results in the following error



    bash: echo: write error: Operation not permitted


CPU subsystem permissions



Device subsystem permissions



Any help would be deeply appreciated, I've been stuck with this for so long and it just doesn't make sense to me.










share|improve this question


























    up vote
    1
    down vote

    favorite












    I'm trying to setup Cgroups for a non-root user glassfish.



    System setup:




    • CentOS 7.2.1511

    • Kernel 3.10.0-327.el7.x86_64

    • Cgroup mounted at /sys/fs/cgroup


    It should be possible to create a Cgroup for non-root user by issuing these commands:





    1. For CPU subsystem:



      $ sudo mkdir /sys/fs/cgroup/cpu/${USER}
      $ sudo chown -R ${USER} /sys/fs/cgroup/cpu/${USER}



    2. For Devices subsystem:



      $ sudo mkdir /sys/fs/cgroup/devices/${USER}
      $ sudo chown -R ${USER} /sys/fs/cgroup/devices/${USER}



    This works for the CPU subsystem. Since I am able to write to control files as glassfish, such as cpu.cfs_period_us like below



        echo 43434 > cpu.cfs_period_us


    But writing to the Devices subsystem such as



        echo 'a *:* rwm' > devices.deny


    Results in the following error



        bash: echo: write error: Operation not permitted


    CPU subsystem permissions



    Device subsystem permissions



    Any help would be deeply appreciated, I've been stuck with this for so long and it just doesn't make sense to me.










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to setup Cgroups for a non-root user glassfish.



      System setup:




      • CentOS 7.2.1511

      • Kernel 3.10.0-327.el7.x86_64

      • Cgroup mounted at /sys/fs/cgroup


      It should be possible to create a Cgroup for non-root user by issuing these commands:





      1. For CPU subsystem:



        $ sudo mkdir /sys/fs/cgroup/cpu/${USER}
        $ sudo chown -R ${USER} /sys/fs/cgroup/cpu/${USER}



      2. For Devices subsystem:



        $ sudo mkdir /sys/fs/cgroup/devices/${USER}
        $ sudo chown -R ${USER} /sys/fs/cgroup/devices/${USER}



      This works for the CPU subsystem. Since I am able to write to control files as glassfish, such as cpu.cfs_period_us like below



          echo 43434 > cpu.cfs_period_us


      But writing to the Devices subsystem such as



          echo 'a *:* rwm' > devices.deny


      Results in the following error



          bash: echo: write error: Operation not permitted


      CPU subsystem permissions



      Device subsystem permissions



      Any help would be deeply appreciated, I've been stuck with this for so long and it just doesn't make sense to me.










      share|improve this question













      I'm trying to setup Cgroups for a non-root user glassfish.



      System setup:




      • CentOS 7.2.1511

      • Kernel 3.10.0-327.el7.x86_64

      • Cgroup mounted at /sys/fs/cgroup


      It should be possible to create a Cgroup for non-root user by issuing these commands:





      1. For CPU subsystem:



        $ sudo mkdir /sys/fs/cgroup/cpu/${USER}
        $ sudo chown -R ${USER} /sys/fs/cgroup/cpu/${USER}



      2. For Devices subsystem:



        $ sudo mkdir /sys/fs/cgroup/devices/${USER}
        $ sudo chown -R ${USER} /sys/fs/cgroup/devices/${USER}



      This works for the CPU subsystem. Since I am able to write to control files as glassfish, such as cpu.cfs_period_us like below



          echo 43434 > cpu.cfs_period_us


      But writing to the Devices subsystem such as



          echo 'a *:* rwm' > devices.deny


      Results in the following error



          bash: echo: write error: Operation not permitted


      CPU subsystem permissions



      Device subsystem permissions



      Any help would be deeply appreciated, I've been stuck with this for so long and it just doesn't make sense to me.







      linux centos permissions cgroups






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 6 '17 at 15:22









      Robin Andersson

      61




      61



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f384324%2flinux-cgroup-writing-to-control-files-working-for-cpu-but-not-device-subsystem%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f384324%2flinux-cgroup-writing-to-control-files-working-for-cpu-but-not-device-subsystem%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt