2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PROJMOD 1M "Feb 22, 2007"
8 projmod \- modify a project's information on the system
12 \fBprojmod\fR [\fB-n\fR] [\fB-A\fR|\fB-f\fR \fIfilename\fR | -]
17 \fBprojmod\fR [\fB-n\fR] [\fB-A\fR|\fB-f\fR \fIfilename\fR | -] [\fB-p\fR \fIprojid\fR [\fB-o\fR]]
18 [\fB-c\fR \fIcomment\fR] [\fB-a\fR|\fB-s\fR|\fB-r\fR] [\fB-U\fR \fIuser\fR [,\fIuser\fR]... ]
19 [\fB-G\fR \fIgroup\fR [,\fIgroup\fR]... ]
20 [ [\fB-K\fR \fIname\fR [=\fIvalue\fR [,\fIvalue\fR]...]...]]
21 [\fB-l\fR \fInew_projectname\fR] \fIproject\fR
27 The \fBprojmod\fR utility modifies a project's definition on the system.
28 \fBprojmod\fR changes the definition of the specified project and makes the
29 appropriate project-related system file and file system changes.
33 The following options are supported:
40 Apply the project's resource controls, as defined in the system's project
41 database, to the project if it is active.
50 Specify that the users, groups, attributes, or attribute values specified by
51 the \fB-U\fR, \fB-G\fR or \fB-K\fR options should be added to the project,
52 rather than replacing the existing member or attribute list.
58 \fB\fB-c\fR \fIcomment\fR\fR
61 Specify \fIcomment\fR as a text string. Generally, \fIcomment\fR contains a
62 short description of the project. This information is stored in the project's
63 \fB/etc/project\fR entry.
69 \fB\fB-f\fR \fIfilename\fR | -\fR
72 Specify the project file to modify or validate or specify input from stdin for
73 validation. As noted under OPERANDS, if you do not specify a project in a
74 \fBprojmod\fR command line, \fBprojmod\fR validates the argument to \fB-f\fR.
75 If you do not use this option, the system project file, \fB/etc/project\fR, is
82 \fB\fB-G\fR \fIgroup\fR [,\fIgroup\fR...]\fR
85 Specify a replacement list of member groups of the project. When used in
86 conjunction with the \fB-a\fR or \fB-r\fR options, this option specifies a list
87 of groups to be added or removed from the project.
93 \fB\fB-K\fR \fIname\fR[=\fIvalue\fR[,\fIvalue\fR...]\fR
96 Specify a replacement list of project attributes for the project. When used in
97 conjunction with the \fB-a\fR, \fB-r\fR, or \fB-s\fR options, this option
98 specifies a list of attribute values to be added, removed, or replaced in the
99 project. Attributes must be delimited by semicolons (\fB;\fR). Multiple
100 \fB-K\fR options can be specified to set, add, remove, or substitute values on
101 multiple keys, such as:
105 -K \fIkey1\fR=\fIvalue1\fR -K "\fIkey2\fR=(\fIvalue2a\fR),(\fIvalue2b\fR)"
109 Resource control attributes use parentheses to specify values for a key.
110 Because many user shells interpret parentheses as special characters, it is
111 best to enclose an argument to \fB-K\fR that contains parentheses with double
112 quotes, as shown above and in EXAMPLES, below. See \fBresource_controls\fR(5)
113 for a description of the resource controls you can specify for a project.
119 \fB\fB-l\fR \fInew_projectname\fR\fR
122 Specify the new project name for the project. The \fInew_projectname\fR
123 argument is a string consisting of characters from the set of alphabetic
124 characters, numeric characters, period (\fB\&.\fR), underline (\fB_\fR), and
125 hyphen (\fB-\fR). The first character should be alphabetic. An error message is
126 written if these restrictions are not met. The project name must also be unique
127 within the project file.
136 Syntax check. Check the format of the existing system project file and
137 modifications only. The contents of the existing project file, such as user
138 names, group names, and resources that are specified in the project attributes
148 This option allows the project ID specified by the \fB-p\fR option to be
149 non-unique within the project file.
155 \fB\fB-p\fR \fIprojid\fR\fR
158 Specify a new project \fBID\fR for the project. It must be a non-negative
159 decimal integer less than \fBMAXUID\fR as defined in \fBparam.h\fR. This value
160 must be unique within the project file if the \fB-o\fR option is not specified.
169 Specify that the users, groups, attributes, or attribute values specified by
170 the \fB-U\fR, \fB-G\fR or \fB-K\fR options should be removed from the project,
171 rather than replacing the existing member or attribute list.
180 Specify that the list of attributes specified by the \fB-K\fR option should
181 have their values replaced. If the attributes do not exist, they are added as
182 if the a option was used. This option has no effect the \fB-U\fR or \fB-G\fR
189 \fB\fB-U\fR \fIuser\fR [,\fIuser\fR...]\fR
192 Specify a replacement list of member users of the project. When used in
193 conjunction with the \fB-a\fR or \fB-r\fR options, this option specifies a list
194 of users to be added or removed from the project.
200 The following operands are supported:
207 An existing project name to be modified or displayed.
216 If no operand is given, the project file is validated without modifying any
222 \fBExample 1 \fRUsing the \fB-K\fR Option for Addition of an Attribute Value
225 Consider the following \fBproject\fR(4) entry:
230 salesaudit:111:Auditing Project::sales,finance: \e
231 process.max-file-size=(priv,52428800,deny); \e
232 task.max-lwps=(priv,100,deny)
238 The preceding would appear as one line in \fB/etc/project\fR. For this and the
239 following examples, the focus is on the attributes field in the \fBproject\fR
240 entry. That is, the last field, the field following the last semicolon.
244 The attributes field for the project \fBsalesaudit\fR lists the following
250 task.max-lwps=(priv,1000,signal=KILL)
256 The following \fBprojmod\fR command adds an action clause to the preceding
262 # projmod -a -K "task.max-lwps=(priv,100,deny)" salesaudit
268 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
273 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
278 \fBExample 2 \fRUsing the \fB-K\fR Option for the Substitution of an Attribute
282 Assume an attributes field in a \fBproject\fR(4) entry for the project
283 \fBsalesaudit\fR that lists the following resource control:
288 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
294 The following \fBprojmod\fR command substitutes the action clause specified in
295 the command for the action clauses in the preceding entry:
300 # projmod -s -K "task.max-lwps=(priv,500,signal=SIGSTOP)" salesaudit
306 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
311 task.max-lwps=(priv,500,signal=SIGSTOP)
316 \fBExample 3 \fRUsing the \fB-K\fR Option for Removal of an Attribute Value
319 Assume an attributes field in a \fBproject\fR(4) entry for a project
320 \fBsalesaudit\fR that lists the following resource control:
325 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
331 The following \fBprojmod\fR command removes the first action clause from the
337 # projmod -r -K "task.max-lwps=(priv,100,deny)" salesaudit
343 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
348 task.max-lwps=(priv,1000,signal=KILL)
353 \fBExample 4 \fRSpecifying Multiple Attribute Values
356 Suppose you want to achieve the following resource controls for the project
362 task.max-lwps=(priv,100,deny)
363 process.max-file-size=(priv,50MB,deny)
369 The following \fBprojmod\fR command adds these resource controls for
375 # projmod -a -K "task.max-lwps=(priv,100,deny)" \e
376 -K "process.max-file-size=(priv,50MB,deny)" salesaudit
382 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
387 task.max-lwps=(priv,100,deny);process.max-file-size=(priv,52428800,deny)
393 In this example, note the effect of the use of the modifier and scaling factor
394 for the resource control \fBprocess.max-file-size\fR. The specification in
400 "process.max-file-size=(priv,50MB,deny)"
406 \&...becomes, in \fB/etc/project\fR:
411 process.max-file-size=(priv,52428800,deny)
417 That is, \fB50MB\fR is expanded to \fB52428800\fR. The modifiers, such as MB,
418 and scaling factors you can use for resource controls are specified in
419 \fBresource_controls\fR(5).
422 \fBExample 5 \fRBinding a Pool to a Project
425 The following command sets the \fBproject.pool\fR attribute for the project
431 # projmod -a -K project.pool=salespool sales
436 \fBExample 6 \fREvaluating Input from \fBstdin\fR
439 The following command uses the \fB-f\fR option without a project name operand
440 to evaluate the contents of an NIS projects map.
445 # ypcat project | projmod -f -
452 In case of an error, \fBprojmod\fR prints an error message and exits with one
453 of the following values:
456 The following exit values are returned:
463 Successful completion.
472 The command syntax was invalid. A usage message for \fBprojmod\fR is displayed.
481 An invalid argument was provided to an option.
490 The \fIprojid\fR given with the \fB-p\fR option is already in use.
499 The project files contain an error. See \fBproject\fR(4).
508 The project to be modified, group, user, or resource does not exist.
517 The project is already in use.
526 Cannot update the \fB/etc/project\fR file.
533 \fB\fB/etc/group\fR\fR
536 System file containing group definitions
542 \fB\fB/etc/project\fR\fR
551 \fB\fB/etc/passwd\fR\fR
560 \fB\fB/etc/shadow\fR\fR
563 System file containing users' encrypted passwords and related information
569 See \fBattributes\fR(5) for descriptions of the following attributes:
577 ATTRIBUTE TYPE ATTRIBUTE VALUE
579 Interface Stability See below.
584 Invocation is evolving. Human readable output is unstable.
588 \fBgroupadd\fR(1M), \fBgroupdel\fR(1M), \fBgroupmod\fR(1M), \fBprojadd\fR(1M),
589 \fBprojdel\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M), \fBusermod\fR(1M),
590 \fBpasswd\fR(4), \fBproject\fR(4), \fBattributes\fR(5),
591 \fBresource_controls\fR(5)
595 The \fBprojmod\fR utility modifies project definitions only in the local
596 \fB/etc/project\fR file. If a network name service such as \fBNIS\fR or
597 \fBLDAP\fR is being used to supplement the local files with additional entries,
598 \fBprojmod\fR cannot change information supplied by the network name service.
599 However \fBprojmod\fR verifies the uniqueness of project name and project
600 \fBID\fR against the external name service.