1projmod(1M)             System Administration Commands             projmod(1M)
2
3
4

NAME

6       projmod - modify a project's information on the system
7

SYNOPSIS

9       projmod [-n] [-A|-f filename | -]
10
11
12       projmod [-n] [-A|-f filename | -] [-p projid [-o]]
13            [-c comment] [-a|-s|-r] [-U user [,user]... ]
14            [-G group [,group]... ]
15            [ [-K name [=value [,value]...]...]]
16            [-l new_projectname] project
17
18

DESCRIPTION

20       The projmod utility modifies a project's definition on the system. pro‐
21       jmod changes the definition of the  specified  project  and  makes  the
22       appropriate project-related system file and file system changes.
23

OPTIONS

25       The following options are supported:
26
27       -A                           Apply  the project's resource controls, as
28                                    defined in the system's project  database,
29                                    to the project if it is active.
30
31
32       -a                           Specify    that    the    users,   groups,
33                                    attributes, or attribute values  specified
34                                    by  the  -U,  -G  or  -K options should be
35                                    added to the project, rather than  replac‐
36                                    ing the existing member or attribute list.
37
38
39       -c comment                   Specify  comment  as a text string. Gener‐
40                                    ally, comment contains a short description
41                                    of the project. This information is stored
42                                    in the project's /etc/project entry.
43
44
45       -f filename | -              Specify the project file to modify or val‐
46                                    idate or specify input from stdin for val‐
47                                    idation. As noted under OPERANDS,  if  you
48                                    do not specify a project in a projmod com‐
49                                    mand line, projmod validates the  argument
50                                    to  -f. If you do not use this option, the
51                                    system project file, /etc/project, is mod‐
52                                    ified.
53
54
55       -G group [,group...]         Specify   a  replacement  list  of  member
56                                    groups of the project. When used  in  con‐
57                                    junction  with  the -a or -r options, this
58                                    option specifies a list of  groups  to  be
59                                    added or removed from the project.
60
61
62       -K name[=value[,value...]    Specify  a  replacement  list  of  project
63                                    attributes for the project. When  used  in
64                                    conjunction   with   the  -a,  -r,  or  -s
65                                    options, this option specifies a  list  of
66                                    attribute  values to be added, removed, or
67                                    replaced in the project.  Attributes  must
68                                    be  delimited  by semicolons (;). Multiple
69                                    -K options can be specified to  set,  add,
70                                    remove,  or  substitute values on multiple
71                                    keys, such as:
72
73                                      -K key1=value1 -K "key2=(value2a),(value2b)"
74
75                                    Resource control attributes use  parenthe‐
76                                    ses  to  specify values for a key. Because
77                                    many user shells interpret parentheses  as
78                                    special  characters, it is best to enclose
79                                    an argument to -K that contains  parenthe‐
80                                    ses with double quotes, as shown above and
81                                    in  EXAMPLES,  below.  See   resource_con‐
82                                    trols(5) for a description of the resource
83                                    controls you can specify for a project.
84
85
86       -l new_projectname           Specify  the  new  project  name  for  the
87                                    project. The new_projectname argument is a
88                                    string consisting of characters  from  the
89                                    set   of  alphabetic  characters,  numeric
90                                    characters, period (.), underline (_), and
91                                    hyphen  (-). The first character should be
92                                    alphabetic. An error message is written if
93                                    these   restrictions   are  not  met.  The
94                                    project name must also  be  unique  within
95                                    the project file.
96
97
98       -n                           Syntax  check.  Check  the  format  of the
99                                    existing system project file and modifica‐
100                                    tions  only.  The contents of the existing
101                                    project file, such as  user  names,  group
102                                    names, and resources that are specified in
103                                    the project attributes are not checked.
104
105
106       -o                           This option allows the project  ID  speci‐
107                                    fied  by  the  -p  option to be non-unique
108                                    within the project file.
109
110
111       -p projid                    Specify a new project ID for the  project.
112                                    It  must be a non-negative decimal integer
113                                    less than MAXUID as  defined  in  param.h.
114                                    This  value  must  be  unique  within  the
115                                    project file if the -o option is not spec‐
116                                    ified.
117
118
119       -r                           Specify    that    the    users,   groups,
120                                    attributes, or attribute values  specified
121                                    by  the  -U,  -G  or  -K options should be
122                                    removed  from  the  project,  rather  than
123                                    replacing the existing member or attribute
124                                    list.
125
126
127       -s                           Specify that the list of attributes speci‐
128                                    fied  by  the  -K option should have their
129                                    values replaced. If the attributes do  not
130                                    exist,  they  are added as if the a option
131                                    was used. This option has no effect the -U
132                                    or -G options.
133
134
135       -U user [,user...]           Specify a replacement list of member users
136                                    of the project. When used  in  conjunction
137                                    with  the  -a  or  -r options, this option
138                                    specifies a list of users to be  added  or
139                                    removed from the project.
140
141

OPERANDS

143       The following operands are supported:
144
145       project    An existing project name to be modified or displayed.
146
147
148       (none)     If  no operand is given, the project file is validated with‐
149                  out modifying any project.
150
151

EXAMPLES

153       Example 1 Using the -K Option for Addition of an Attribute Value
154
155
156       Consider the following project(4) entry:
157
158
159         salesaudit:111:Auditing Project::sales,finance: \
160           process.max-file-size=(priv,52428800,deny); \
161           task.max-lwps=(priv,100,deny)
162
163
164
165       The preceding would appear as one line in /etc/project.  For  this  and
166       the  following  examples,  the  focus is on the attributes field in the
167       project entry. That is, the last field, the field  following  the  last
168       semicolon.
169
170
171
172       The  attributes  field  for  the project salesaudit lists the following
173       resource control:
174
175
176         task.max-lwps=(priv,1000,signal=KILL)
177
178
179
180       The following projmod command adds an action clause  to  the  preceding
181       entry:
182
183
184         # projmod -a -K "task.max-lwps=(priv,100,deny)" salesaudit
185
186
187
188       ...with the resulting attributes field in the entry for salesaudit:
189
190
191         task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
192
193
194       Example  2  Using  the  -K  Option for the Substitution of an Attribute
195       Value
196
197
198       Assume an attributes field in a project(4) entry for the project  sale‐
199       saudit that lists the following resource control:
200
201
202         task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
203
204
205
206       The  following  projmod command substitutes the action clause specified
207       in the command for the action clauses in the preceding entry:
208
209
210         # projmod -s -K "task.max-lwps=(priv,500,signal=SIGSTOP)" salesaudit
211
212
213
214       ...with the resulting attributes field in the entry for salesaudit:
215
216
217         task.max-lwps=(priv,500,signal=SIGSTOP)
218
219
220       Example 3 Using the -K Option for Removal of an Attribute Value
221
222
223       Assume an attributes field in a project(4) entry for a project salesau‐
224       dit that lists the following resource control:
225
226
227         task.max-lwps=(priv,100,deny),(priv,1000,signal=KILL)
228
229
230
231       The  following projmod command removes the first action clause from the
232       preceding entry:
233
234
235         # projmod -r -K "task.max-lwps=(priv,100,deny)" salesaudit
236
237
238
239       ...with the resulting attributes field in the entry for salesaudit:
240
241
242         task.max-lwps=(priv,1000,signal=KILL)
243
244
245       Example 4 Specifying Multiple Attribute Values
246
247
248       Suppose you want to achieve the following  resource  controls  for  the
249       project salesaudit:
250
251
252         task.max-lwps=(priv,100,deny)
253         process.max-file-size=(priv,50MB,deny)
254
255
256
257       The following projmod command adds these resource controls for salesau‐
258       dit:
259
260
261         # projmod -a -K "task.max-lwps=(priv,100,deny)" \
262         -K "process.max-file-size=(priv,50MB,deny)" salesaudit
263
264
265
266       ...with the resulting attributes field in the entry for salesaudit:
267
268
269         task.max-lwps=(priv,100,deny);process.max-file-size=(priv,52428800,deny)
270
271
272
273       In this example, note the effect of the use of the modifier and scaling
274       factor  for  the resource control process.max-file-size. The specifica‐
275       tion in projmod:
276
277
278         "process.max-file-size=(priv,50MB,deny)"
279
280
281
282       ...becomes, in /etc/project:
283
284
285         process.max-file-size=(priv,52428800,deny)
286
287
288
289       That is, 50MB is expanded to 52428800. The modifiers, such as  MB,  and
290       scaling  factors  you  can  use  for resource controls are specified in
291       resource_controls(5).
292
293
294       Example 5 Binding a Pool to a Project
295
296
297       The following command sets the project.pool attribute for  the  project
298       sales.
299
300
301         # projmod -a -K project.pool=salespool sales
302
303
304       Example 6 Evaluating Input from stdin
305
306
307       The following command uses the -f option without a project name operand
308       to evaluate the contents of an NIS projects map.
309
310
311         # ypcat project | projmod -f -
312
313

EXIT STATUS

315       In case of an error, projmod prints an error message and exits with one
316       of the following values:
317
318
319       The following exit values are returned:
320
321       0     Successful completion.
322
323
324       2     The  command  syntax  was invalid. A usage message for projmod is
325             displayed.
326
327
328       3     An invalid argument was provided to an option.
329
330
331       4     The projid given with the -p option is already in use.
332
333
334       5     The project files contain an error. See project(4).
335
336
337       6     The project to be modified, group, user,  or  resource  does  not
338             exist.
339
340
341       9     The project is already in use.
342
343
344       10    Cannot update the /etc/project file.
345
346

FILES

348       /etc/group      System file containing group definitions
349
350
351       /etc/project    System project file
352
353
354       /etc/passwd     System password file
355
356
357       /etc/shadow     System  file  containing users' encrypted passwords and
358                       related information
359
360

ATTRIBUTES

362       See attributes(5) for descriptions of the following attributes:
363
364
365
366
367       ┌────────────────────────────────────────────────────────┬─────────────────┐
368       │                    ATTRIBUTE TYPE                      │ ATTRIBUTE VALUE │
369       ├────────────────────────────────────────────────────────┼─────────────────┤
370       │Availability                                            │ SUNWesu         │
371       ├────────────────────────────────────────────────────────┼─────────────────┤
372       │Interface Stability                                     │ See below.      │
373       └────────────────────────────────────────────────────────┴─────────────────┘
374
375
376       Invocation is evolving. Human readable output is unstable.
377

SEE ALSO

379       groupadd(1M),  groupdel(1M),  groupmod(1M),  projadd(1M),  projdel(1M),
380       useradd(1M),    userdel(1M),    usermod(1M),   passwd(4),   project(4),
381       attributes(5), resource_controls(5)
382

NOTES

384       The projmod utility modifies project  definitions  only  in  the  local
385       /etc/project  file.  If  a  network name service such as NIS or LDAP is
386       being used to supplement the local files with additional entries, proj‐
387       mod  cannot  change  information  supplied by the network name service.
388       However projmod verifies the uniqueness of project name and project  ID
389       against the external name service.
390
391
392
393SunOS 5.11                        22 Feb 2007                      projmod(1M)
Impressum