=head1 NAME

fileserver - Initializes the File Server component of the fs process

=head1 SYNOPSIS

fileserver [B<-d> I<debug level>]  [B<-p> I<number of processes>]
[B<-spare> I<number of spare blocks>]
[B<-pctspare> I<percentage spare>]  [B<-b> I<buffers>]
[B<-l> I<large vnodes>]  [B<-s> I<small  nodes>]
[B<-vc> I<volume cachesize>]  [B<-w> I<call back wait interval>]
[B<-cb> I<number of call backs>]
[B<-banner> (print banner every 10 minutes)]
[B<-novbc> (whole volume cbs disabled)]
[B<-implicit> I<admin mode bits: rlidwka>]
[B<-hr> I<number of hours between refreshing the host cps>]
[B<-busyat> I<redirect clients when queue > n>]
[B<-rxpck> I<number of rx extra packets>]
[B<-rxdbg> (enable rx debugging)]
[B<-rxdbge> (enable rxevent debugging)]
[B<-m> I<min percentage spare in partition>]
[B<-lock> (keep fileserver from swapping)]
[B<-L> (large server conf)]  [B<-S> (small server conf)]
[B<-k> I<stack size>]  [B<-realm> I<Kerberos realm name>]
[B<-udpsize> I<size of socket buffer in bytes>]
[B<-enable_peer_stats>]  [B<-enable_process_stats>]
[B<-help>]

This command does not use the syntax conventions of the AFS command
suites. Provide the command name and all option names in full.

=head1 DESCRIPTION

The C<fileserver> command initializes the File Server component of the B<fs>
process. In the conventional configuration, its binary file is located
in the B</usr/afs/bin> directory on a file server machine.

The C<fileserver> command is not normally issued at the command shell
prompt, but rather placed into a database server machine's
B</usr/afs/local/BosConfig> file with the C<bos create> command. If it is
ever issued at the command shell prompt, the issuer must be logged
onto a file server machine as the local superuser B<root>.

The File Server creates the B</usr/afs/logs/FileLog> log file as it
initializes, if the file does not already exist. It does not write a
detailed trace by default, but use the B<-d> option to increase the
amount of detail. Use the C<bos getlog> command to display the contents
of the log file.

The command's arguments enable the administrator to control many
aspects of the File Server's performance, as detailed in the L</"OPTIONS">
section. By default the C<fileserver> command sets values for many
arguments that are suitable for a medium-sized file server machine. To
set values suitable for a small or large file server machine, use the
B<-S> or B<-L> flag respectively. The following list describes the
parameters and corresponding argument for which the C<fileserver> command
sets default values, and L</"Table 1"> summarizes the setting for each of
the three machine sizes.

=over

=item *

The maximum number of lightweight processes (LWPs) the File Server
uses to handle requests for data; corresponds to the B<-p> argument.
The File Server always uses a minimum of 32 KB for these
processes.

=item *

The maximum number of directory blocks the File Server caches in
memory; corresponds to the B<-b> argument. Each cached directory
block (buffer) consumes 2,092 bytes of memory.

=item *

The maximum number of large vnodes the File Server caches in
memory for tracking directory elements; corresponds to the B<-l>
argument. Each large vnode consumes 292 bytes of memory.

=item *

The maximum number of small vnodes the File Server caches in
memory for tracking file elements; corresponds to the B<-s> argument.
Each small vnode consumes 100 bytes of memory.

=item *

The maximum volume cache size, which determines how many volumes
the File Server can cache in memory before having to retrieve data
from disk; corresponds to the B<-vc> argument.

=item *

The maximum number of callback structures the File Server caches
in memory; corresponds to the B<-cb> argument. Each callback
structure consumes 16 bytes of memory.

=item *

The maximum number of B<Rx> packets the File Server uses; corresponds
to the B<-rxpck> argument. Each packet consumes 1544 bytes of memory.

=back

=head2 Table 1

B<File Server configuration parameters>

 -------------------------------------------------
 Parameter         |        Configuration:        
 (Argument)        | Small   | Medium    | Large  
                   | (-S)    | (default) | (-L)   
 -------------------------------------------------
 Number of         | 6       | 9         | 12     
 LWPs (-p)         |         |           |        
 -------------------------------------------------
 Number of cached  | 70      | 90        | 120    
 directory blocks  |         |           |        
 (-b)              |         |           |        
 -------------------------------------------------
 Number of cached  | 200     | 400       | 600    
 large vnodes (-l) |         |           |        
 -------------------------------------------------
 Number of cached  | 200     | 400       | 600    
 small vnodes (-s) |         |           |        
 -------------------------------------------------
 Maximum volume    | 200     | 400       | 600    
 cache size (-vc)  |         |           |        
 -------------------------------------------------
 Number of         | 20,000  | 60,000    | 64,000 
 callbacks (-cb)   |         |           |        
 -------------------------------------------------
 Number of Rx      | 100     | 150       | 200    
 packets (-rxpck)  |         |           |        
 -------------------------------------------------

To override any of the values, provide the indicated argument (which
can be combined with the B<-S> or B<-L> flag).

The amount of memory required for the File Server varies. The
approximate default memory usage is 751 KB when the B<-S> flag is used
(small configuration), 1.1 MB when all defaults are used (medium
configuration), and 1.4 MB when the B<-L> flag is used (large
configuration). If additional memory is available, increasing the
value of the B<-cb> and B<-vc> arguments can improve File Server performance
most directly.

By default, the File Server allows a volume to exceed its quota by 1
MB when an application is writing data to an existing file in a volume
that is full. The File Server still does not allow users to create new
files in a full volume. To change the default, use one of the
following arguments:

=over

=item *

Set the B<-spare> argument to the number of extra kilobytes that the
File Server allows as overage. A value of B<0> allows no overage.

=item *

Set the B<-pctspare> argument to the percentage of the volume's quota
the File Server allows as overage.

=back

By default, the File Server implicitly grants the B<a> (B<administer>) and B<l>
(B<lookup>) permissions to the B<system:administrators> on the access
control list (ACL) of every directory in the volumes stored on its
file server machine. In other words, the group's members can exercise
those two permissions even when an entry for the group does not appear
on an ACL. To change the set of default permissions, use the B<-implicit>
argument.

The File Server maintains a I<host current protection subgroup> (I<host
CPS>) for each client machine from which it has received a data access
request. Like the CPS for a user, a host CPS lists all of the
Protection Database groups to which the machine belongs, and the File
Server compares the host CPS to a directory's ACL to determine in what
manner users on the machine are authorized to access the directory's
contents. When the C<pts adduser> or C<pts removeuser> command is used to
change the groups to which a machine belongs, the File Server must
recompute the machine's host CPS in order to notice the change. By
default, the File Server contacts the Protection Server every two
hours to recompute host CPSs, implying that it can take that long for
changed group memberships to become effective. To change this
frequency, use the B<-hr> argument.

=over

=item B<Note:>

The AIX operating system does not automatically reserve a part
of each partition to avoid the negative consequences that can result
when the space on a partition is completely exhausted. Therefore, the
AIX version of the File Server creates an 8% disk reserve
automatically. To change the percentage, use the B<-m> argument.

=back

The File Server generates the following message when a partition is
nearly full:

   No space left on device

=head1 OPTIONS

=over 4

=item B<-d> I<debug level>

Sets the detail level for the debugging trace written to the
B</usr/afs/logs/FileLog> file. Provide one of the following
values, each of which produces an increasingly detailed trace:
B<0>, B<1>, B<5>, B<25>, and B<125>. The default value of B<0> produces only a
few messages.

=item B<-p> I<number of processes>

Sets the number of threads to run. Provide a positive integer.
The File Server creates and uses five threads for special
purposes, in addition to the number specified (but if this
argument specifies the maximum possible number, the File Server
automatically uses five of the threads for its own purposes).

The maximum number of threads can differ in each release of
AFS. Consult the IBM AFS Release Notes for the current release.

=item B<-spare> I<number of spare blocks>

Specifies the number of additional kilobytes an application can
store in a volume after the quota is exceeded. Provide a
positive integer; a value of B<0> prevents the volume from ever
exceeding its quota. Do not combine this argument with the
B<-pctspare> argument.

=item B<-pctspare> I<percentage spare>

Specifies the amount by which the File Server allows a volume
to exceed its quota, as a percentage of the quota. Provide an
integer between B<0> and B<99>. A value of B<0> prevents the volume from
ever exceeding its quota. Do not combine this argument with the
B<-spare> argument.

=item B<-b> I<buffers>

Sets the number of directory buffers. Provide a positive
integer.

=item B<-l> I<large vnodes>

Sets the number of large vnodes available in memory for caching
directory elements. Provide a positive integer.

=item B<-s> I<small  nodes>

Sets the number of small vnodes available in memory for caching
file elements. Provide a positive integer.

=item B<-vc> I<volume cachesize>

Sets the number of volumes the File Server can cache in memory.
Provide a positive integer.

=item B<-w> I<call back wait interval>

Sets the interval at which the daemon spawned by the File
Server performs its maintenance tasks. Do not use this
argument; changing the default value can cause unpredictable
behavior.

=item B<-cb> I<number of call backs>

Sets the number of callbacks the File Server can track. Provide
a positive integer.

=item B<-banner>

Prints the following banner to B</dev/console> about every 10
minutes.

File Server is running at I<time>.

=item B<-novbc>

Prevents the File Server from breaking the callbacks that Cache
Managers hold on a volume that the File Server is reattaching
after the volume was offline (as a result of the C<vos restore>
command, for example). Use of this flag is strongly
discouraged.

=item B<-implicit> I<admin mode bits: rlidwka>

Defines the set of permissions granted by default to the
B<system:administrators> group on the ACL of every directory in a
volume stored on the file server machine. Provide one or more
of the standard permission letters (B<rlidwka>) and auxiliary
permission letters (B<ABCDEFGH>), or one of the shorthand
notations for groups of permissions (B<all>, B<none>, B<read>, and
B<write>). To review the meaning of the permissions, see the L<fs_setacl(1)>
reference page.

=over

=item B<Note:>

The File Server always implicitly grants the B<a> permission to the
B<system:administrators> group, even if you use the B<none> value.

=back

=item B<-hr> I<number of hours between refreshing the host cps>

Specifies how often the File Server refreshes its knowledge of
the machines that belong to protection groups (refreshes the
host CPSs for machines). The File Server must update this
information to enable users from machines recently added to
protection groups to access data for which those machines now
have the necessary ACL permissions.

=item B<-busyat> I<redirect clients when queue >

Defines the number of incoming RPCs that can be waiting for a
response from the File Server before the File Server returns
the error code B<VBUSY> to the Cache Manager that sent the latest
RPC. In response, the Cache Manager retransmits the RPC after a
delay. This argument prevents the accumulation of so many
waiting RPCs that the File Server can never process them all.
Provide a positive integer. The default value is 600.

=item B<-rxpck> I<number of rx extra packets>

Controls the number of Rx packets the File Server uses to store
data for incoming RPCs that it is currently handling, that are
waiting for a response, and for replies that are not yet
complete. Provide a positive integer.

=item B<-rxdbg>

Writes a trace of the File Server's operations on Rx packets to
the file B</usr/afs/logs/rx_dbg>.

=item B<-rxdbge>

Writes a trace of the File Server's operations on Rx events
(such as retransmissions) to the file B</usr/afs/logs/rx_dbg>.

=item B<-m> I<min percentage spare in partition>

Specifies the percentage of each AFS server partition that the
AIX version of the File Server creates as a reserve. Specify an
integer value between B<0> and B<30>; the default is 8%. A value of B<0>
means that the partition can become completely full, which can
have serious negative consequences.

=over

=item B<Note:>

This argument is available only on machines running the AIX
operating system, and so does not appear in the syntax statement when
the B<-help> flag is used on other system types.

=back

=item B<-lock>

Prevents any portion of the B<fileserver> binary from being paged
(swapped) out of memory on a file server machine running the
IRIX operating system.

=over

=item B<Note:>

This argument is available only on machines running the IRIX
operating system, and so does not appear in the syntax statement when
the B<-help> flag is used on other system types.

=back

=item B<-L>

Sets values for many arguments in a manner suitable for a large
file server machine. Combine this flag with any option except
the B<-S> flag; omit both flags to set values suitable for a
medium-sized file server machine.

=item B<-S>

Sets values for many arguments in a manner suitable for a small
file server machine. Combine this flag with any option except
the B<-L> flag; omit both flags to set values suitable for a
medium-sized file server machine.

=item B<-k> I<stack size>

Sets the LWP stack size in units of 1 kilobyte. Do not use this
argument, and in particular do not specify a value less than
the default of 24.

=item B<-realm> I<Kerberos realm name>

Defines the Kerberos realm name for the File Server to use. If
this argument is not provided, it uses the realm name
corresponding to the cell listed in the local
B</usr/afs/etc/ThisCell> file.

=item B<-udpsize> I<size of socket buffer in bytes>

Sets the size of the UDP buffer, which is 64 KB by default.
Provide a positive integer, preferably larger than the default.

=item B<-enable_peer_stats>

Activates the collection of Rx statistics and allocates memory
for their storage. For each connection with a specific UDP port
on another machine, a separate record is kept for each type of
RPC (FetchFile, GetStatus, and so on) sent or received. To
display or otherwise access the records, use the Rx Monitoring
API.

=item B<-enable_process_stats>

Activates the collection of Rx statistics and allocates memory
for their storage. A separate record is kept for each type of
RPC (FetchFile, GetStatus, and so on) sent or received,
aggregated over all connections to other machines. To display
or otherwise access the records, use the Rx Monitoring API.

=item B<-help>

Prints the online help for this command. All other valid
options are ignored.

=back

=head1 EXAMPLES

The following C<bos create> command creates an B<fs> process on the file
server machine B<fs2.abc.com> that uses the large configuration size, and
allows volumes to exceed their quota by 10%. Type the command on a
single line:

  bos create -server fs2.abc.com -instance fs -type fs   \
             -cmd "/usr/afs/bin/fileserver -pctspare 10 \
             -L" /usr/afs/bin/volserver /usr/afs/bin/salvager

=head1 PRIVILEGE REQUIRED

The issuer must be logged in as the superuser B<root> on a file server
machine to issue the command at a command shell prompt. It is
conventional instead to create and start the process by issuing the
C<bos create> command.

=head1 CAVEATS

Do not use the B<-k> and B<-w> arguments, which are intended for use by the
AFS Development group only. Changing them from their default values
can result in unpredictable File Server behavior. In any case, on many
operating systems the File Server uses native threads rather than the
LWP threads, so using the B<-k> argument to set the number of LWP threads
has no effect.

Do not specify both the B<-spare> and B<-pctspare> arguments. Doing so
causes the File Server to exit, leaving an error message in the
B</usr/afs/logs/FileLog> file.

Options that are available only on some system types, such as the B<-m>
and B<-lock> options, appear in the output generated by the B<-help> option
only on the relevant system type.

=head1 COPYRIGHT

IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

Converted from html to pod by Alf Wachsmann <alfw@slac.stanford.edu>, 2003,
and Elizabeth Cassell <e_a_c@mailsnare.net>, 2004,
Stanford Linear Accelerator Center, a department of Stanford University.

=head1 SEE ALSO

L<BosConfig(1)>,
L<FileLog(1)>,
L<bos_create(1)>,
L<bos_getlog(1)>,
L<fs_setacl(1)>,
L<salvager(1)>,
L<volserver(1)>

=cut
