工作负载管理器 分配规则的示例

此示例显示配置 Config 的顶级 rules 文件 (/etc/wlm/Config/rules 文件)。

* This file contains the rules used by WLM to
* assign a process to a superclass
*
* class resvd user    group   application     type  tag
db1      -      -       -    /usr/bin/oracle*      _DB1
db2      -      -       -    /usr/bin/oracle*      _DB2
devlt    -      -      dev        -            -    -
VPs      -   bob,ted    -         -            -    -
acctg    -      -     acct*       -            -    -
System   -    root      -         -            -    -
Default  -      -       -         -            -    -

以下是 /etc/wlm/Config/devlt/rules 文件中 devlt 超类的 rules 文件的示例:

* This file contains the rules used by WLM to
* assign a process to a subclass of the
* superclass devlt
*
* class  resvd   user    group  application         type       tag
hackers   -    jim,liz     -       -                 -          -
hogs      -       -        -       -             64bit+plock    -
editors   -     !sue       -   /bin/vi,/bin/emacs    -          -
build     -       -        -   /bin/make,/bin/cc     -          -
Default   -       -        -       -                 -          -
注: 星号 (*) 是 rules 文件中使用的注释字符。
以下是使用此规则文件的示例。 以下示例假设没有将所描述的超类和子类的继承属性设置为 yes。 如果启用了继承,那么新的进程将从它们的父进程继承超类或子类。
  • 如果用户 joe 从组 acct3 执行 /bin/vi,那么进程将被放入超类 acctg 中。
  • 如果用户 sue 从组 dev 执行了 /bin/emacs,那么进程将被放入超类 devlt(组标识匹配)中,但不会分类到编辑器子类,因为已将该用户从那个类中排除。 在缺省情况下,进程将进入 devlt。
  • 当带有 oracle 用户标识和 dbm 组标识的数据库管理员启动 /usr/sbin/oracle 以对 DB1 数据库服务时,进程将被分类至 Default 超类。 仅当进程的标记设置为 _DB1 时,才能将它分配给超类 db1。