3 bos_create - Defines a new process in the BosConfig file and starts it
10 B<bos create> S<<< B<-server> <I<machine name>> >>>
11 S<<< B<-instance> <I<server process name>> >>> S<<< B<-type> <I<server type>> >>>
12 S<<< B<-cmd> <I<command lines>>+ >>> S<<< [B<-notifier> <I<notifier program>>] >>>
13 S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-help>]
15 B<bos c> S<<< B<-s> <I<machine name>> >>> S<<< B<-i> <I<server process name>> >>>
16 S<<< B<-t> <I<server type>> >>> S<<< B<-cm> <I<command lines>>+ >>>
17 S<<< [B<-not> <I<notifier program>>] >>> S<<< [B<-ce> <I<cell name>>] >>> [B<-noa>]
25 The B<bos create> command creates a server process entry in the
26 F</usr/afs/local/BosConfig> file on the server machine named by the
27 B<-server> argument, sets the process's status to C<Run> in the
28 F<BosConfig> file and in memory, and starts the process.
30 A server process's entry in the F<BosConfig> file defines its name, its
31 type, the command that initializes it, and optionally, the name of a
32 notifier program that runs when the process terminates.
36 A server process entry of type B<fs> as described below will not work with
37 a demand-attach File Server, and a server process entry of type B<dafs>
38 for a demand-attach File Server will not work with a traditional File
39 Server. When switching from one File Server implementation to another,
40 remove the existing server process entry and create a new one. See
41 L</EXAMPLES> below for an example of switching from a traditional File
42 Server to a demand-attach File Server.
48 =item B<-server> <I<machine name>>
50 Indicates the server machine on which to define and start the new
51 process. Identify the machine by IP address or its host name (either
52 fully-qualified or abbreviated unambiguously). For details, see L<bos(8)>.
54 =item B<-instance> <I<server process name>>
56 Names the process to define and start. Any name is acceptable, but for the
57 sake of simplicity it is best to use the last element of the process's
58 binary file pathname (or the instance type for B<fs> and B<dafs>), and to
59 use the same name on every server machine. The conventional names, as used
60 in all AFS documentation, are:
66 The Backup Server process.
70 The process that combines the Demand Attach File Server, Volume Server,
71 Salvageserver and Salvager processes (B<dafileserver>, B<davolserver>,
72 B<salvageserver>, and B<dasalvager>).
76 The process that combines the File Server, Volume Server, and Salvager
77 processes (B<fileserver>, B<volserver>, and B<salvager>).
81 The Authentication Server process.
85 The Protection Server process.
89 The client portion of the Update Server process that retrieves binary
90 files from the F</usr/afs/bin> directory of the binary distribution
91 machine for this machine's CPU/operating system type. (The name of the
92 binary is B<upclient>, but the C<bin> suffix distinguishes this process
97 The client portion of the Update Server process that retrieves
98 configuration files from the F</usr/afs/etc> directory of the system
99 control machine. (The name of the binary is B<upclient>, but the C<etc>
100 suffix distinguishes this process from C<upclientbin>.)
104 The server portion of the Update Server process.
108 The Volume Location (VL) Server process.
112 =item B<-type> <I<server type>>
114 Specifies the process's type. The acceptable values are:
120 Use this value for cron-type processes that the BOS Server starts only at
121 a defined daily or weekly time, rather than whenever it detects that the
122 process has terminated. AFS does not define any such processes by default,
123 but makes this value available for administrator use. Define the time for
124 command execution as part of the B<-cmd> argument to the B<bos create>
129 Use this value only for the dafs process, which combines the File Server,
130 Volume Server, Salvage Server, and Salvager processes in order to operate
131 as a Demand Attach File Server. If one of the component processes
132 terminates, the BOS Server shuts down and restarts the process in the
137 Use this value only for the fs process, which combines the File Server,
138 Volume Server and Salvager processes. If one of the component processes
139 terminates, the BOS Server shuts down and restarts the processes in the
144 Use this value for all processes listed as acceptable values to the
145 B<-instance> argument, except for the B<fs> and B<dafs> processes.
146 There are no interdependencies between simple processes, so the
147 BOS Server can stop and start them independently as necessary.
151 =item B<-cmd> <I<command lines>>+
153 Specifies each command the BOS Server runs to start the process. Specify
154 no more than six commands (which can include the command's options, in
155 which case the entire string is surrounded by double quotes); any
156 additional commands are ignored.
158 For a simple process, provide the complete pathname of the process's
159 binary file on the local disk (for example, F</usr/afs/bin/ptserver> for
160 the Protection Server). If including any of the initialization command's
161 options, surround the entire command in double quotes (C<"">). The
162 B<upclient> process has a required argument, and the commands for all
163 other processes take optional arguments.
165 For the B<fs> process, provide the complete pathname of the local disk
166 binary file for each of the component processes: B<fileserver>,
167 B<volserver>, and B<salvager>, in that order. The standard binary
168 directory is F</usr/afs/bin>. If including any of an initialization
169 command's options, surround the entire command in double quotes (C<"">).
171 For the B<dafs> process, provide the complete pathname of the local disk
172 binary file for each of the component processes: B<dafileserver>,
173 B<davolserver>, B<salvageserver>, and B<dasalvager>, in that order. The
174 standard binary directory is F</usr/afs/bin>. If including any of an
175 initialization command's options, surround the entire command in double
178 For a cron process, provide two parameters:
184 The complete local disk pathname of either an executable file or a command
185 from one of the AFS suites (complete with all of the necessary
186 arguments). Surround this parameter with double quotes (C<"">) if it
191 A specification of when the BOS Server executes the file or command
192 indicated by the first parameter. There are three acceptable values:
198 The string C<now>, which directs the BOS Server to execute the file or
199 command immediately and only once. It is usually simpler to issue the
200 command directly or issue the B<bos exec> command.
204 A time of day. The BOS Server executes the file or command daily at the
205 indicated time. Separate the hours and minutes with a colon (I<hh:MM>),
206 and use either 24-hour format, or a value in the range from C<1:00>
207 through C<12:59> with the addition of C<am> or C<pm>. For example, both
208 C<14:30> and C<"2:30 pm"> indicate 2:30 in the afternoon. Surround this
209 parameter with double quotes (C<"">) if it contains a space.
213 A day of the week and time of day, separated by a space and surrounded
214 with double quotes (C<"">). The BOS Server executes the file or command
215 weekly at the indicated day and time. For the day, provide either the
216 whole name or the first three letters, all in lowercase letters (C<sunday>
217 or C<sun>, C<thursday> or C<thu>, and so on). For the time, use the same
218 format as when specifying the time alone.
224 =item B<-notifier> <I<notifier program>>
226 Specifies the complete pathname on the local disk of a program that the
227 BOS Server invokes when the process terminates. The AFS distribution does
228 not include any notifier programs, but this argument is available for
229 administrator use. See L</NOTES>.
231 =item B<-cell> <I<cell name>>
233 Names the cell in which to run the command. Do not combine this argument
234 with the B<-localauth> flag. For more details, see L<bos(8)>.
238 Assigns the unprivileged identity C<anonymous> to the issuer. Do not
239 combine this flag with the B<-localauth> flag. For more details, see
244 Constructs a server ticket using a key from the local
245 F</usr/afs/etc/KeyFile> file. The B<bos> command interpreter presents the
246 ticket to the BOS Server during mutual authentication. Do not combine this
247 flag with the B<-cell> or B<-noauth> options. For more details, see
252 Prints the online help for this command. All other valid options are
259 The following command defines and starts the simple process
260 C<ptserver> on the machine C<fs3.example.com>:
262 % bos create -server fs3.example.com -instance ptserver -type simple \
263 -cmd /usr/afs/bin/ptserver
265 The following command defines and starts the simple process C<upclientbin>
266 on the machine C<fs4.example.com>. It references C<fs1.example.com> as the
267 source for updates to binary files, checking for changes to the
268 F</usr/afs/bin> directory every 120 seconds.
270 % bos create -server fs4.example.com -instance upclientbin -type simple \
271 -cmd "/usr/afs/bin/upclient fs1.example.com -clear -t 120 \
274 The following command creates the B<fs> process C<fs> on the machine
275 C<fs4.example.com> (a traditional File Server with associated processes). Type
276 the command on a single line.
278 % bos create -server fs4.example.com -instance fs -type fs \
279 -cmd /usr/afs/bin/fileserver /usr/afs/bin/volserver \
280 /usr/afs/bin/salvager
282 The following command creates the B<dafs> process C<dafs> on the machine
283 C<fs4.example.com> (a demand-attach File Server with associated processes).
284 Type the command on a single line.
286 % bos create -server fs4.example.com -instance dafs -type dafs \
287 -cmd /usr/afs/bin/dafileserver \
288 /usr/afs/bin/davolserver \
289 /usr/afs/bin/salvageserver /usr/afs/bin/dasalvager
291 The following command creates a cron process called C<userbackup> on the
292 machine C<fs5.example.com>, so that the BOS Server issues the indicated B<vos
293 backupsys> command each day at 3:00 a.m. (the command creates a backup
294 version of every volume in the file system whose name begins with
295 C<user>). Note that the issuer provides the complete pathname to the
296 B<vos> command, includes the B<-localauth> flag on it, and types the
297 entire B<bos create> command on one line.
299 % bos create -server fs5.example.com -instance userbackup -type cron \
300 -cmd "/usr/afs/bin/vos backupsys -prefix user -localauth" 03:00
302 To switch from a traditional File Server to a demand-attach File Server,
305 % bos status localhost -instance fs -long
307 to see the current B<fileserver> and B<volserver> flags for an existing
308 traditional File Server configuration. (Substitute the C<dafs> instance
309 for an existing demand-attach File Server.) Then, run:
311 % bos stop localhost fs -localauth
312 % bos delete localhost fs -localauth
313 % bos create localhost dafs dafs \
314 "/usr/afs/bin/dafileserver <fileserver-flags>" \
315 "/usr/afs/bin/davolserver <volserver-flags>" \
316 /usr/afs/bin/salvageserver /usr/afs/bin/dasalvager
318 replacing <fileserver-flags> and <volserver-flags> with the flags from the
319 previous configuration. This will stop the traditional File Server and
320 start a demand-attach File Server. The binaries at the paths provided must
321 already be updated to binaries built with demand-attach enabled.
323 =head1 PRIVILEGE REQUIRED
325 The issuer must be listed in the F</usr/afs/etc/UserList> file on the
326 machine named by the B<-server> argument, or must be logged onto a server
327 machine as the local superuser C<root> if the B<-localauth> flag is
330 The B<bos create> command cannot be run against servers which are in
335 If the B<-notifier> argument is included when this command is used to
336 define and start a process, the BOS Server invokes the indicated
337 I<notifier program> when the process exits. The intended use of a notifier
338 program is to inform administrators when a process exits unexpectedly, but
339 it can be used to perform any appropriate actions. The following
340 paragraphs describe the bnode and bnode_proc structures in which the
341 BOS Server records information about the exiting process.
343 The BOS Server constructs and sends on the standard output stream one
344 bnode and one bnode_proc structure for each exiting process associated
345 with the notifier program. It brackets each structure with appropriate
346 C<BEGIN> and C<END> statements (C<BEGIN bnode> and C<END bnode>, C<BEGIN
347 bnode_proc> and C<END bnode_proc>), which immediately follow the preceding
348 newline character with no intervening spaces or other characters. If the
349 notifier program does not need information from a structure, it can scan
350 ahead in the input stream for the C<END> statement.
352 In general, each field in a structure is a string of ASCII text terminated
353 by the newline character. The format of the information within a structure
354 possibly varies slightly depending on the type of process associated with
355 the notifier program.
357 The C code for the bnode and bnode_proc structures follows. Note that the
358 structures sent by the BOS Server do not necessarily include all of the
359 fields described here, because some are used only for internal record
360 keeping. The notifier process must robustly handle the absence of expected
361 fields, as well as the presence of unexpected fields, on the standard
364 For proper performance, the notifier program must continue processing the
365 input stream until it detects the end-of-file (EOF). The BOS Server closes
366 the standard input file descriptor to the notifier process when it has
367 completed delivery of the data, and it is the responsibility of the
368 notifier process to terminate properly.
370 struct bnode contents:
373 struct bnode *next; /* next pointer in top-level's list */
374 char *name; /* instance name */
375 long nextTimeout; /* next time this guy should be awakened */
376 long period; /* period between calls */
377 long rsTime; /* time we started counting restarts */
378 long rsCount; /* count of restarts since rsTime */
379 struct bnode_type *type; /* type object */
380 struct bnode_ops *ops; /* functions implementing bnode class */
381 long procStartTime; /* last time a process was started */
382 long procStarts; /* number of process starts */
383 long lastAnyExit; /* last time a process exited for any reason */
384 long lastErrorExit; /* last time a process exited unexpectedly */
385 long errorCode; /* last exit return code */
386 long errorSignal; /* last proc terminating signal */
387 char *lastErrorName; /* name of proc that failed last */
388 short refCount; /* reference count */
389 short flags; /* random flags */
390 char goal; /* 1=running or 0=not running */
391 char fileGoal; /* same, but to be stored in file */
394 Format of struct bnode explosion:
396 printf("name: %s\n",tp->name);
397 printf("rsTime: %ld\n", tp->rsTime);
398 printf("rsCount: %ld\n", tp->rsCount);
399 printf("procStartTime: %ld\n", tp->procStartTime);
400 printf("procStarts: %ld\n", tp->procStarts);
401 printf("lastAnyExit: %ld\n", tp->lastAnyExit);
402 printf("lastErrorExit: %ld\n", tp->lastErrorExit);
403 printf("errorCode: %ld\n", tp->errorCode);
404 printf("errorSignal: %ld\n", tp->errorSignal);
405 printf("lastErrorName: %s\n", tp->lastErrorName);
406 printf("goal: %d\n", tp->goal);
408 struct bnode_proc contents:
411 struct bnode_proc *next; /* next guy in top-level's list */
412 struct bnode *bnode; /* bnode creating this process */
413 char *comLine; /* command line used to start this process */
414 char *coreName; /* optional core file component name */
415 long pid; /* pid if created */
416 long lastExit; /* last termination code */
417 long lastSignal; /* last signal that killed this guy */
418 long flags; /* flags giving process state */
421 Format of struct bnode_proc explosion:
423 printf("comLine: %s\n", tp->comLine);
424 printf("coreName: %s\n", tp->coreName);
425 printf("pid: %ld\n", tp->pid);
426 printf("lastExit: %ld\n", tp->lastExit);
427 printf("lastSignal: %ld\n", tp->lastSignal);
452 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
454 This documentation is covered by the IBM Public License Version 1.0. It was
455 converted from HTML to POD by software written by Chas Williams and Russ
456 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.