在 Oracle® Solaris 11.2 中进行资源管理

退出打印视图

更新时间: 2014 年 7 月
 
 

如何定义项目和查看当前项目

此示例说明如何使用 projadd 命令添加项目条目,以及如何使用 projmod 命令修改此条目。

  1. 成为 root 用户或承担等效角色。
  2. 使用 projects –l 查看系统上缺省的 /etc/project 文件。
    # projects -l
    system
            projid : 0
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    user.root
            projid : 1
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    noproject
            projid : 2
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    default
            projid : 3
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    group.staff
            projid : 10
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
  3. 添加名为 booksite 的项目。将该项目指定给名为 mark 的用户,同时指定项目 ID 号 4113
    # projadd -U mark -p 4113 booksite
  4. 再次查看 /etc/project 文件。
    # projects -l
    system
            projid : 0
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    user.root
            projid : 1
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    noproject
            projid : 2
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    default
            projid : 3
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    group.staff
            projid : 10
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    booksite
            projid : 4113
            comment: ""
            users  : mark
            groups : (none)
            attribs: 
  5. 在注释字段中添加描述项目的注释。
    # projmod -c `Book Auction Project' booksite
  6. 查看 /etc/project 文件中的更改。
    # projects -l
    system
            projid : 0
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    user.root
            projid : 1
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    noproject
            projid : 2
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    default
            projid : 3
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    group.staff
            projid : 10
            comment: ""
            users  : (none)
            groups : (none)
            attribs: 
    booksite
            projid : 4113
            comment: "Book Auction Project"
            users  : mark
            groups : (none)
            attribs: 

另请参见

要将项目、任务和进程绑定到池,请参见设置池属性并绑定到池