8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / projmod.1m
blob5225c127aeb47debab1223d3dd2db3d59f4fe9b9
1 '\" te
2 .\" Copyright (c) 2018 Peter Tribble.
3 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH PROJMOD 1M "Jan 7, 2018"
8 .SH NAME
9 projmod \- modify a project's information on the system
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBprojmod\fR [\fB-n\fR] [\fB-A\fR|\fB-f\fR \fIfilename\fR | -]
14 .fi
16 .LP
17 .nf
18 \fBprojmod\fR [\fB-n\fR] [\fB-A\fR|\fB-f\fR \fIfilename\fR | -] [\fB-p\fR \fIprojid\fR [\fB-o\fR]]
19      [\fB-c\fR \fIcomment\fR] [\fB-a\fR|\fB-s\fR|\fB-r\fR] [\fB-U\fR \fIuser\fR[,\fIuser\fR]...]
20      [\fB-G\fR \fIgroup\fR[,\fIgroup\fR]...]
21      [\fB-K\fR \fIname\fR[=\fIvalue\fR[,\fIvalue\fR]...]]...
22      [\fB-l\fR \fInew_projectname\fR] \fIproject\fR
23 .fi
25 .SH DESCRIPTION
26 .LP
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.
30 .SH OPTIONS
31 .LP
32 The following options are supported:
33 .sp
34 .ne 2
35 .na
36 \fB\fB-A\fR\fR
37 .ad
38 .RS 29n
39 Apply the project's resource controls, as defined in the system's project
40 database, to the project if it is active.
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fB-a\fR\fR
47 .ad
48 .RS 29n
49 Specify that the users, groups, attributes, or attribute values specified by
50 the \fB-U\fR, \fB-G\fR or \fB-K\fR options should be added to the project,
51 rather than replacing the existing member or attribute list.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fB-c\fR \fIcomment\fR\fR
58 .ad
59 .RS 29n
60 Specify \fIcomment\fR as a text string. Generally, \fIcomment\fR contains a
61 short description of the project. This information is stored in the project's
62 \fB/etc/project\fR entry.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB\fB-f\fR \fIfilename\fR | -\fR
69 .ad
70 .RS 29n
71 Specify the project file to modify or validate or specify input from stdin for
72 validation. As noted under OPERANDS, if you do not specify a project in a
73 \fBprojmod\fR command line, \fBprojmod\fR validates the argument to \fB-f\fR.
74 If you do not use this option, the system project file, \fB/etc/project\fR, is
75 modified.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fB-G\fR \fIgroup\fR[,\fIgroup\fR]...]fR
82 .ad
83 .RS 29n
84 Specify a replacement list of member groups of the project. When used in
85 conjunction with the \fB-a\fR or \fB-r\fR options, this option specifies a list
86 of groups to be added or removed from the project.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fB-K\fR \fIname\fR[=\fIvalue\fR[,\fIvalue\fR]...]\fR
93 .ad
94 .RS 29n
95 Specify a replacement list of project attributes for the project. When used in
96 conjunction with the \fB-a\fR, \fB-r\fR, or \fB-s\fR options, this option
97 specifies a list of attribute values to be added, removed, or replaced in the
98 project. Attributes must be delimited by semicolons (\fB;\fR). Multiple
99 \fB-K\fR options can be specified to set, add, remove, or substitute values on
100 multiple keys, such as:
102 .in +2
104 -K \fIkey1\fR=\fIvalue1\fR -K "\fIkey2\fR=(\fIvalue2a\fR),(\fIvalue2b\fR)"
106 .in -2
108 Resource control attributes use parentheses to specify values for a key.
109 Because many user shells interpret parentheses as special characters, it is
110 best to enclose an argument to \fB-K\fR that contains parentheses with double
111 quotes, as shown above and in EXAMPLES, below. See \fBresource_controls\fR(5)
112 for a description of the resource controls you can specify for a project.
116 .ne 2
118 \fB\fB-l\fR \fInew_projectname\fR\fR
120 .RS 29n
121 Specify the new project name for the project. The \fInew_projectname\fR
122 argument is a string consisting of characters from the set of alphabetic
123 characters, numeric characters, period (\fB\&.\fR), underline (\fB_\fR), and
124 hyphen (\fB-\fR). The first character should be alphabetic. An error message is
125 written if these restrictions are not met. The project name must also be unique
126 within the project file.
130 .ne 2
132 \fB\fB-n\fR\fR
134 .RS 29n
135 Syntax check. Check the format of the existing system project file and
136 modifications only. The contents of the existing project file, such as user
137 names, group names, and resources that are specified in the project attributes
138 are not checked.
142 .ne 2
144 \fB\fB-o\fR\fR
146 .RS 29n
147 This option allows the project ID specified by the \fB-p\fR option to be
148 non-unique within the project file.
152 .ne 2
154 \fB\fB-p\fR \fIprojid\fR\fR
156 .RS 29n
157 Specify a new project \fBID\fR for the project. It must be a non-negative
158 decimal integer less than \fBMAXUID\fR as defined in \fB<sys/param.h>\fR. This
159 value must be unique within the project file if the \fB-o\fR option is not
160 specified.
164 .ne 2
166 \fB\fB-r\fR\fR
168 .RS 29n
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.
175 .ne 2
177 \fB\fB-s\fR\fR
179 .RS 29n
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
183 options.
187 .ne 2
189 \fB\fB-U\fR \fIuser\fR[,\fIuser\fR]...\fR
191 .RS 29n
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.
197 .SH OPERANDS
199 The following operands are supported:
201 .ne 2
203 \fB\fIproject\fR\fR
205 .RS 11n
206 An existing project name to be modified or displayed.
210 .ne 2
212 \fB\fI(none)\fR\fR
214 .RS 11n
215 If no operand is given, the project file is validated without modifying any
216 project.
219 .SH EXAMPLES
221 \fBExample 1\fR Using the \fB-K\fR Option for Addition of an Attribute Value
224 Consider the following \fBproject\fR(4) entry:
227 .in +2
229 salesaudit:111:Auditing Project::sales,finance: \e
230   process.max-file-size=(priv,52428800,deny); \e
231   task.max-lwps=(priv,100,deny)
233 .in -2
237 The preceding would appear as one line in \fB/etc/project\fR. For this and the
238 following examples, the focus is on the attributes field in the \fBproject\fR
239 entry. That is, the last field, the field following the last semicolon.
243 The attributes field for the project \fBsalesaudit\fR lists the following
244 resource control:
247 .in +2
249 task.max-lwps=(priv,1000,signal=KILL)
251 .in -2
255 The following \fBprojmod\fR command adds an action clause to the preceding
256 entry:
259 .in +2
261 # projmod -a -K "task.max-lwps=(priv,100,deny)" salesaudit
263 .in -2
267 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
270 .in +2
272 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
274 .in -2
277 \fBExample 2\fR Using the \fB-K\fR Option for the Substitution of an Attribute
278 Value
281 Assume an attributes field in a \fBproject\fR(4) entry for the project
282 \fBsalesaudit\fR that lists the following resource control:
285 .in +2
287 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
289 .in -2
293 The following \fBprojmod\fR command substitutes the action clause specified in
294 the command for the action clauses in the preceding entry:
297 .in +2
299 # projmod -s -K "task.max-lwps=(priv,500,signal=SIGSTOP)" salesaudit
301 .in -2
305 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
308 .in +2
310 task.max-lwps=(priv,500,signal=SIGSTOP)
312 .in -2
315 \fBExample 3\fR Using the \fB-K\fR Option for Removal of an Attribute Value
318 Assume an attributes field in a \fBproject\fR(4) entry for a project
319 \fBsalesaudit\fR that lists the following resource control:
322 .in +2
324 task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
326 .in -2
330 The following \fBprojmod\fR command removes the first action clause from the
331 preceding entry:
334 .in +2
336 # projmod -r -K "task.max-lwps=(priv,100,deny)" salesaudit
338 .in -2
342 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
345 .in +2
347 task.max-lwps=(priv,1000,signal=KILL)
349 .in -2
352 \fBExample 4\fR Specifying Multiple Attribute Values
355 Suppose you want to achieve the following resource controls for the project
356 \fBsalesaudit\fR:
359 .in +2
361 task.max-lwps=(priv,100,deny)
362 process.max-file-size=(priv,50MB,deny)
364 .in -2
368 The following \fBprojmod\fR command adds these resource controls for
369 \fBsalesaudit\fR:
372 .in +2
374 # projmod -a -K "task.max-lwps=(priv,100,deny)" \e
375 -K "process.max-file-size=(priv,50MB,deny)" salesaudit
377 .in -2
381 \&...with the resulting attributes field in the entry for \fBsalesaudit\fR:
384 .in +2
386 task.max-lwps=(priv,100,deny);process.max-file-size=(priv,52428800,deny)
388 .in -2
392 In this example, note the effect of the use of the modifier and scaling factor
393 for the resource control \fBprocess.max-file-size\fR. The specification in
394 \fBprojmod\fR:
397 .in +2
399 "process.max-file-size=(priv,50MB,deny)"
401 .in -2
405 \&...becomes, in \fB/etc/project\fR:
408 .in +2
410 process.max-file-size=(priv,52428800,deny)
412 .in -2
416 That is, \fB50MB\fR is expanded to \fB52428800\fR. The modifiers, such as MB,
417 and scaling factors you can use for resource controls are specified in
418 \fBresource_controls\fR(5).
421 \fBExample 5\fR Binding a Pool to a Project
424 The following command sets the \fBproject.pool\fR attribute for the project
425 \fBsales\fR.
428 .in +2
430 # projmod -a -K project.pool=salespool sales
432 .in -2
435 \fBExample 6\fR Evaluating Input from \fBstdin\fR
438 The following command uses the \fB-f\fR option without a project name operand
439 to evaluate the contents of an NIS projects map.
442 .in +2
444 # ypcat project | projmod -f -
446 .in -2
448 .SH EXIT STATUS
450 In case of an error, \fBprojmod\fR prints an error message and exits with one
451 of the following values:
454 The following exit values are returned:
456 .ne 2
458 \fB\fB0\fR\fR
460 .RS 6n
461 Successful completion.
465 .ne 2
467 \fB\fB2\fR\fR
469 .RS 6n
470 The command syntax was invalid. A usage message for \fBprojmod\fR is displayed.
474 .ne 2
476 \fB\fB3\fR\fR
478 .RS 6n
479 An invalid argument was provided to an option.
483 .ne 2
485 \fB\fB4\fR\fR
487 .RS 6n
488 The \fIprojid\fR given with the \fB-p\fR option is already in use.
492 .ne 2
494 \fB\fB5\fR\fR
496 .RS 6n
497 The project files contain an error. See \fBproject\fR(4).
501 .ne 2
503 \fB\fB6\fR\fR
505 .RS 6n
506 The project to be modified, group, user, or resource does not exist.
510 .ne 2
512 \fB\fB9\fR\fR
514 .RS 6n
515 The project is already in use.
519 .ne 2
521 \fB\fB10\fR\fR
523 .RS 6n
524 Cannot update the \fB/etc/project\fR file.
527 .SH FILES
528 .ne 2
530 \fB\fB/etc/group\fR\fR
532 .RS 16n
533 System file containing group definitions
537 .ne 2
539 \fB\fB/etc/project\fR\fR
541 .RS 16n
542 System project file
546 .ne 2
548 \fB\fB/etc/passwd\fR\fR
550 .RS 16n
551 System password file
555 .ne 2
557 \fB\fB/etc/shadow\fR\fR
559 .RS 16n
560 System file containing users' encrypted passwords and related information
563 .SH ATTRIBUTES
565 See \fBattributes\fR(5) for descriptions of the following attributes:
570 box;
571 c | c
572 l | l .
573 ATTRIBUTE TYPE  ATTRIBUTE VALUE
575 Interface Stability     See below.
580 Invocation is evolving. Human readable output is unstable.
581 .SH SEE ALSO
583 \fBgroupadd\fR(1M), \fBgroupdel\fR(1M), \fBgroupmod\fR(1M), \fBprojadd\fR(1M),
584 \fBprojdel\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M), \fBusermod\fR(1M),
585 \fBpasswd\fR(4), \fBproject\fR(4), \fBattributes\fR(5),
586 \fBresource_controls\fR(5)
587 .SH NOTES
589 The \fBprojmod\fR utility modifies project definitions only in the local
590 \fB/etc/project\fR file. If a network name service
591 is being used to supplement the local files with additional entries,
592 \fBprojmod\fR cannot change information supplied by the network name service.
593 However \fBprojmod\fR verifies the uniqueness of project name and project
594 \fBID\fR against the external name service.