projmod - modify a project's information on the system
projmod [-n] [-A|-f filename | -]
projmod [-n] [-A|-f filename | -] [-p projid [-o]] [-c comment] [-a|-s|-r] [-U user [,user]... ] [-G group [,group]... ] [ [-K name [=value [,value]...]...]] [-l new_projectname] project
The projmod utility modifies a project's definition on the system. projmod changes the definition of the specified project and makes the appropriate project-related system file and file system changes.
The following options are supported:
-A
-a
-c comment
-f filename | -
-G group [,group...]
-K name[=value[,value...]
-K key1=value1 -K "key2=(value2a),(value2b)"
Resource control attributes use parentheses to specify values for a key. Because many user shells interpret parentheses as special characters, it is best to enclose an argument to -K that contains parentheses with double quotes, as shown above and in EXAMPLES, below. See resource_controls(5) for a description of the resource controls you can specify for a project.
-l new_projectname
-n
-o
-p projid
-r
-s
-U user [,user...]
The following operands are supported:
project
(none)
Example 1 Using the -K Option for Addition of an Attribute Value
Consider the following project(4) entry:
salesaudit:111:Auditing Project::sales,finance: \ process.max-file-size=(priv,52428800,deny); \ task.max-lwps=(priv,100,deny)
The preceding would appear as one line in /etc/project. For this and the following examples, the focus is on the attributes field in the project entry. That is, the last field, the field following the last semicolon.
The attributes field for the project salesaudit lists the following resource control:
task.max-lwps=(priv,1000,signal=KILL)
The following projmod command adds an action clause to the preceding entry:
# projmod -a -K "task.max-lwps=(priv,100,deny)" salesaudit
...with the resulting attributes field in the entry for salesaudit:
task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
Example 2 Using the -K Option for the Substitution of an Attribute Value
Assume an attributes field in a project(4) entry for the project salesaudit that lists the following resource control:
task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
The following projmod command substitutes the action clause specified in the command for the action clauses in the preceding entry:
# projmod -s -K "task.max-lwps=(priv,500,signal=SIGSTOP)" salesaudit
...with the resulting attributes field in the entry for salesaudit:
task.max-lwps=(priv,500,signal=SIGSTOP)
Example 3 Using the -K Option for Removal of an Attribute Value
Assume an attributes field in a project(4) entry for a project salesaudit that lists the following resource control:
task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
The following projmod command removes the first action clause from the preceding entry:
# projmod -r -K "task.max-lwps=(priv,100,deny)" salesaudit
...with the resulting attributes field in the entry for salesaudit:
task.max-lwps=(priv,1000,signal=KILL)
Example 4 Specifying Multiple Attribute Values
Suppose you want to achieve the following resource controls for the project salesaudit:
task.max-lwps=(priv,100,deny) process.max-file-size=(priv,50MB,deny)
The following projmod command adds these resource controls for salesaudit:
# projmod -a -K "task.max-lwps=(priv,100,deny)" \ -K "process.max-file-size=(priv,50MB,deny)" salesaudit
...with the resulting attributes field in the entry for salesaudit:
task.max-lwps=(priv,100,deny);process.max-file-size=(priv,52428800,deny)
In this example, note the effect of the use of the modifier and scaling factor for the resource control process.max-file-size. The specification in projmod:
"process.max-file-size=(priv,50MB,deny)"
...becomes, in /etc/project:
process.max-file-size=(priv,52428800,deny)
That is, 50MB is expanded to 52428800. The modifiers, such as MB, and scaling factors you can use for resource controls are specified in resource_controls(5).
Example 5 Binding a Pool to a Project
The following command sets the project.pool attribute for the project sales.
# projmod -a -K project.pool=salespool sales
Example 6 Evaluating Input from stdin
The following command uses the -f option without a project name operand to evaluate the contents of an NIS projects map.
# ypcat project | projmod -f -
In case of an error, projmod prints an error message and exits with one of the following values:
The following exit values are returned:
0
2
3
4
5
6
9
10
/etc/group
/etc/project
/etc/passwd
/etc/shadow
See attributes(5) for descriptions of the following attributes:
|
Invocation is evolving. Human readable output is unstable.
groupadd(1M), groupdel(1M), groupmod(1M), projadd(1M), projdel(1M), useradd(1M), userdel(1M), usermod(1M), passwd(4), project(4), attributes(5), resource_controls(5)
The projmod utility modifies project definitions only in the local /etc/project file. If a network name service such as NIS or LDAP is being used to supplement the local files with additional entries, projmod cannot change information supplied by the network name service. However projmod verifies the uniqueness of project name and project ID against the external name service.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |