6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / projadd.1m
blob7a92c237d44fd63abe001f36e3eda08655787bd6
1 '\" te
2 .\" Copyright (c) 2001, 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 PROJADD 1M "Sep 30, 2004"
7 .SH NAME
8 projadd \- administer a new project on the system
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBprojadd\fR [\fB-n\fR] [\fB-f\fR \fIfilename\fR] [\fB-p\fR \fIprojid\fR [\fB-o\fR]] [\fB-c\fR \fIcomment\fR]
13      [\fB-U\fR \fIuser\fR [,\fIuser\fR]... ] [\fB-G\fR \fIgroup\fR [,\fIgroup\fR]... ]
14      [ [\fB-K\fR \fIname\fR [=\fIvalue\fR [,\fIvalue\fR]...]...]] \fIproject\fR
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 \fBprojadd\fR adds a new project entry to the \fB/etc/project\fR file. If the
21 files backend is being used for the project database, the new project is
22 available for use immediately upon the completion of the \fBprojadd\fR command.
23 .SH OPTIONS
24 .sp
25 .LP
26 The following options are supported:
27 .sp
28 .ne 2
29 .na
30 \fB\fB-c\fR \fIcomment\fR\fR
31 .ad
32 .RS 29n
33 Add a project comment. Comments are stored in the project's entry in the
34 \fB/etc/project\fR file. Generally, comments contain a short description of the
35 project and are used as the field for the project's full name.
36 .sp
37 Specify \fIcomment\fR as a text string. \fIcomment\fR cannot contain a colon
38 (\fB:\fR) or NEWLINE.
39 .RE
41 .sp
42 .ne 2
43 .na
44 \fB\fB-f\fR \fIfilename\fR\fR
45 .ad
46 .RS 29n
47 Specify the project file to modify. If no \fIfilename\fR is specified, the
48 system project file, \fB/etc/project\fR, is modified.
49 .RE
51 .sp
52 .ne 2
53 .na
54 \fB\fB-G\fR \fIgroup\fR[,group...]\fR
55 .ad
56 .RS 29n
57 Specify a group list for the project.
58 .RE
60 .sp
61 .ne 2
62 .na
63 \fB\fB-K\fR \fIname\fR[=\fIvalue\fR[,\fIvalue\fR...]\fR
64 .ad
65 .RS 29n
66 Specify an attribute list for the project. Multiple \fB-K\fR options can be
67 specified to set values on multiple keys, such as:
68 .sp
69 .in +2
70 .nf
71 -K \fIkey1\fR=\fIvalue1\fR -K "\fIkey2\fR=(\fIvalue2a\fR),(\fIvalue2b\fR)"
72 .fi
73 .in -2
75 Resource control attributes use parentheses to specify values for a key.
76 Because many user shells interpret parentheses as special characters, it is
77 best to enclose an argument to \fB-K\fR that contains parentheses with double
78 quotes, as shown above and in EXAMPLES, below. See \fBresource_controls\fR(5)
79 for a description of the resource controls you can specify for a project.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fB-n\fR\fR
86 .ad
87 .RS 29n
88 Syntax check. Check the format of the existing system project file and
89 modifications only. The contents of the existing project file, such as user
90 names, group names, and resources that are specified in the project attributes
91 are not checked.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fB-o\fR\fR
98 .ad
99 .RS 29n
100 This option allows the project ID specified by the \fB-p\fR option to be
101 non-unique within the project file.
105 .ne 2
107 \fB\fB-p\fR \fIprojid\fR\fR
109 .RS 29n
110 Set the project \fBID\fR of the new project.
112 Specify \fIprojid\fR as a non-negative decimal integer below \fBUID_MAX\fR as
113 defined in \fBlimits.h\fR. \fIprojid\fR defaults to the next available unique
114 number above the highest number currently assigned. For example, if
115 \fIprojid\fRs \fB100\fR, \fB105\fR, and \fB200\fR are assigned, the next
116 default \fIprojid\fR is \fB201\fR. \fIprojid\fRs between \fB0\fR-\fB99\fR are
117 reserved by SunOS.
121 .ne 2
123 \fB\fB-U\fR \fIuser\fR[,user...]\fR
125 .RS 29n
126 Specify a user list for the project.
129 .SH OPERANDS
132 The following operands are supported:
134 .ne 2
136 \fB\fIproject\fR\fR
138 .RS 11n
139 The name of the project to create. The \fIproject\fR operand is a string
140 consisting of characters from the set of alphabetic characters, numeric
141 characters, underline (_), and hyphen (-). The period ('.') is reserved for
142 projects with special meaning to the operating system. The first character of
143 the project name must be a letter. An error message is displayed if these
144 restrictions are not met.
147 .SH EXAMPLES
149 \fBExample 1 \fRAdding a Project
152 The following command creates the project \fBsalesaudit\fR and sets the
153 resource controls specified as arguments to the \fB-K\fR option.
156 .in +2
158 projadd -p 111 -G sales,finance -c "Auditing Project" \e
159    -K "rcap.max-rss=10GB" \e
160    -K "process.max-file-size=(priv,50MB,deny)" \e
161    -K "task.max-lwps=(priv,100,deny)" salesaudit
163 .in -2
167 This command would produce the following entry in \fB/etc/project\fR:
170 .in +2
172 salesaudit:111:Auditing Project::sales,finance: \e
173 process.max-file-size=(priv,52428800,deny); \e
174 rcap.max-rss=10737418240;task.max-lwps=(priv,100,deny)
176 .in -2
180 Note that the preceding would appear as one line in \fB/etc/project\fR.
184 Comparing the \fBprojadd\fR command and resulting output in \fB/etc/project\fR,
185 note the effect of the scaling factor in the resource cap
186 (\fBrcap.max-rss=10GB\fR) and the resource control
187 (\fBprocess.max-file-size=(priv,50MB,deny)\fR). Modifiers, such as B, KB, and
188 MB, and scaling factors are specified in \fBresource_controls\fR(5).
190 .SH EXIT STATUS
193 The following exit values are returned:
195 .ne 2
197 \fB\fB0\fR\fR
199 .RS 6n
200 Successful completion.
204 .ne 2
206 \fB\fB2\fR\fR
208 .RS 6n
209 The command syntax was invalid. A usage message for \fBprojadd\fR is displayed.
213 .ne 2
215 \fB\fB3\fR\fR
217 .RS 6n
218 An invalid argument was provided to an option.
222 .ne 2
224 \fB\fB4\fR\fR
226 .RS 6n
227 The \fIprojid\fR given with the \fB-p\fR option is already in use.
231 .ne 2
233 \fB\fB5\fR\fR
235 .RS 6n
236 The project files contain an error. See \fBproject\fR(4).
240 .ne 2
242 \fB\fB6\fR\fR
244 .RS 6n
245 The project to be added, group, user, or resource does not exist.
249 .ne 2
251 \fB\fB9\fR\fR
253 .RS 6n
254 The project is already in use.
258 .ne 2
260 \fB\fB10\fR\fR
262 .RS 6n
263 Cannot update the \fB/etc/project\fR file.
266 .SH FILES
268 .ne 2
270 \fB\fB/etc/project\fR\fR
272 .RS 16n
273 System project file
276 .SH ATTRIBUTES
279 See \fBattributes\fR(5) for descriptions of the following attributes:
284 box;
285 c | c
286 l | l .
287 ATTRIBUTE TYPE  ATTRIBUTE VALUE
289 Interface Stability     See below.
294 Invocation is evolving. Human readable output is unstable.
295 .SH SEE ALSO
298 \fBprojects\fR(1), \fBgroupadd\fR(1M), \fBgroupdel\fR(1M), \fBgroupmod\fR(1M),
299 \fBgrpck\fR(1M), \fBprojdel\fR(1M), \fBprojmod\fR(1M), \fBuseradd\fR(1M),
300 \fBuserdel\fR(1M), \fBusermod\fR(1M), \fBproject\fR(4), \fBattributes\fR(5),
301 \fBresource_controls\fR(5)
302 .SH NOTES
305 In case of an error, \fBprojadd\fR prints an error message and exits with a
306 non-zero status.
309 \fBprojadd\fR adds a project definition only on the local system. If a network
310 name service such as NIS or LDAP is being used to supplement the local
311 \fB/etc/project\fR file with additional entries, \fBprojadd\fR cannot change
312 information supplied by the network name service.