System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones

ProcedureHow to Use prctl to Temporarily Change a Value

This example procedure uses the prctl command to temporarily add a new privileged value to deny the use of more than three LWPs per project for the x-files project. The result is comparable to the result in How to Set the Maximum Number of LWPs for Each Task in a Project.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Use newtask to join the x-files project.

    # newtask -p x-files
  3. Use the id command with the -p option to verify that the correct project has been joined.

    # id -p
    uid=0(root) gid=1(other) projid=101(x-files)
  4. Add a new privileged value for project.max-lwps that limits the number of LWPs to three.

    # prctl -n project.max-lwps -t privileged -v 3 -e deny -i project x-files
  5. Verify the result.

    # prctl -n project.max-lwps -i project x-files
    process: 111108: csh
            privileged       3       -   deny                      -
            system       2.15G     max   deny                      -