openafs/doc/html/AdminReference/auarf053.htm

656 lines
30 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4//EN">
<HTML><HEAD>
<TITLE>Administration Reference</TITLE>
<!-- Begin Header Records ========================================== -->
<!-- /tmp/idwt3672/auarf000.scr converted by idb2h R4.2 (359) ID -->
<!-- Workbench Version (AIX) on 3 Oct 2000 at 16:18:30 -->
<META HTTP-EQUIV="updated" CONTENT="Tue, 03 Oct 2000 16:18:29">
<META HTTP-EQUIV="review" CONTENT="Wed, 03 Oct 2001 16:18:29">
<META HTTP-EQUIV="expires" CONTENT="Thu, 03 Oct 2002 16:18:29">
</HEAD><BODY>
<!-- (C) IBM Corporation 2000. All Rights Reserved -->
<BODY bgcolor="ffffff">
<!-- End Header Records ============================================ -->
<A NAME="Top_Of_Page"></A>
<H1>Administration Reference</H1>
<HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf052.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Bot_Of_Page"><IMG SRC="../bot.gif" BORDER="0" ALT="[Bottom of Topic]"></A> <A HREF="auarf054.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P>
<P>
<H2><A NAME="HDRPACKAGECONFIG" HREF="auarf002.htm#ToC_51">package Configuration File</A></H2>
<P><STRONG>Purpose</STRONG>
<A NAME="IDX4038"></A>
<A NAME="IDX4039"></A>
<A NAME="IDX4040"></A>
<P>Provides instructions for the <B>package</B> command
<P><STRONG>Description</STRONG>
<P>The <B>package</B> configuration file defines the file system elements
that the <B>package</B> command creates or alters on the local disk of an
AFS client machine it is configuring. Use the <B>-config</B> or
<B>-fullconfig</B> argument to the <B>package</B> command to identify
the configuration file to use.
<P><B>Summary of Configuration File Instructions</B>
<P>The configuration file can include one or more instances of each of the
following instructions, each on its own line. A more detailed
description of each instruction's syntax follows this list.
<DL>
<P><DT><B>B
</B><DD>Defines a block special device, such as a disk, which deals with input in
units of multi-byte command blocks
<P><DT><B>C
</B><DD>Defines a character special device, such as a terminal or tty, which deals
with input in single character units
<P><DT><B>D
</B><DD>Creates a directory
<P><DT><B>F
</B><DD>Creates or alters a file to match the contents of a specified source file
<P><DT><B>L
</B><DD>Creates a symbolic link
<P><DT><B>S
</B><DD>Defines a socket, which is a communications device for UDP and TCP/IP
connections
<P><DT><B>%define
</B><DD>Defines a variable or declares a string as defined
<P><DT><B>%ifdef
</B><DD>Specifies an action to perform if a certain string is declared or defined
<P><DT><B>%ifndef
</B><DD>Specifies an action to perform if a certain string is not declared or
defined
<P><DT><B>%include
</B><DD>Includes a library file
<P><DT><B>%undef
</B><DD>Declares a string not to be defined, or a variable no longer to have a
value
</DL>
<P><B>The B and C Instructions for Defining Block and Character Special
Devices</B>
<A NAME="IDX4041"></A>
<A NAME="IDX4042"></A>
<A NAME="IDX4043"></A>
<A NAME="IDX4044"></A>
<A NAME="IDX4045"></A>
<A NAME="IDX4046"></A>
<A NAME="IDX4047"></A>
<A NAME="IDX4048"></A>
<A NAME="IDX4049"></A>
<A NAME="IDX4050"></A>
<A NAME="IDX4051"></A>
<A NAME="IDX4052"></A>
<A NAME="IDX4053"></A>
<A NAME="IDX4054"></A>
<A NAME="IDX4055"></A>
<P>The <B>B</B> instruction in a <B>package</B> configuration file
defines a block special device, such as a disk, that deals with input in units
of multi-byte command blocks. The <B>C</B> instruction defines a
character special device, such as a terminal or tty, that deals with input in
single character units. They share a common syntax:
<PRE> {<B>B </B>| <B>C</B>} <VAR>device_name</VAR> <VAR>major_device</VAR> <VAR>minor_device</VAR> <VAR>owner</VAR> <VAR>group</VAR> <VAR>mode_bits</VAR>
</PRE>
<P>where
<DL>
<P><DT><B>B
</B><DD>Indicates the definition of a block special device. It must be a
capital letter.
<P><DT><B>C
</B><DD>Indicates the definition of character special device. It must be a
capital letter.
<P><DT><B><VAR>device_name</VAR>
</B><DD>Names the special device to define. To learn the name format
appropriate to the machine's system type, consult the hardware or
operating system documentation.
<P><DT><B><VAR>major_device</VAR>
</B><DD>Specifies the device's major device number in decimal format.
To learn the correct value for the machine's system type, consult the
hardware or operating system documentation.
<P><DT><B><VAR>minor_device</VAR>
</B><DD>Specifies the device's minor device number in one of hexadecimal,
octal, or decimal format. Precede a hexadecimal number with the string
<B>0x</B> (zero and the letter <B>x</B>) or an octal number with a
<B>0</B> (zero). A number without either prefix is interpreted as a
decimal. To learn the correct value for the machine's system type,
consult the hardware or operating system documentation.
<P><DT><B><VAR>owner</VAR>
</B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
the device's owner in the output from the UNIX <B>ls -l</B>
command.
<P><DT><B><VAR>group</VAR>
</B><DD>Specifies the group name or UNIX group ID (GID) of the group to be
designated the device's group in the output from the UNIX <B>ls
-lg</B> command.
<P><DT><B><VAR>mode_bits</VAR>
</B><DD>Defines the device's UNIX mode bits. Acceptable values are the
standard three- or four-digit numbers corresponding to combinations of
permissions. Examples: <B>755</B> corresponds to
<B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
</DL>
<P><B>The D Instruction for Creating a Directory</B>
<A NAME="IDX4056"></A>
<A NAME="IDX4057"></A>
<A NAME="IDX4058"></A>
<A NAME="IDX4059"></A>
<A NAME="IDX4060"></A>
<A NAME="IDX4061"></A>
<A NAME="IDX4062"></A>
<P>The <B>D</B> instruction in a <B>package</B> configuration file
creates a directory on the local disk. If a symbolic link, file, or
other element on the local disk has the same name, it is replaced with a
directory. If the directory already exists, its owner, group, and mode
bits are changed if necessary to conform with the instruction. The
instruction has the following syntax:
<PRE> <B>D</B>[<VAR>update_code</VAR>] <VAR>directory</VAR> <VAR>owner</VAR> <VAR>group</VAR> <VAR>mode_bits</VAR>
</PRE>
<P>where
<DL>
<P><DT><B>D
</B><DD>Indicates the creation of a directory. It must be a capital
letter.
<P><DT><B><VAR>update_code</VAR>
</B><DD>Modulates the directory creation instruction. It is optional and
follows the letter <B>D</B> directly, without an intervening space.
Choose one of the two acceptable values:
<DL>
<P><DT><B>X
</B><DD>Indicates that the directory is a <B>lost+found</B> directory (used by
the <B>fsck</B> program).
<P><DT><B>R
</B><DD>Removes any subdirectory (along its contents) or file that exists in the
existing directory on the local disk but for which an instruction does not
appear in the configuration file.
</DL>
<P><DT><B><VAR>directory</VAR>
</B><DD>Specifies the full pathname of the directory to create.
<P><DT><B><VAR>owner</VAR>
</B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
the directory's owner in the output from the UNIX <B>ls -ld</B>
command.
<P><DT><B><VAR>group</VAR>
</B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
the directory's group in the output from the UNIX <B>ls -lgd</B>
command.
<P><DT><B><VAR>mode_bits</VAR>
</B><DD>Defines the directory's UNIX mode bits. Acceptable values are
the standard three- or four-digit numbers corresponding to combinations of
permissions. Examples: <B>755</B> corresponds to
<B>drwxr-xr-x</B>, and <B>644</B> to <B>drw-r--r--</B>.
</DL>
<P><B>The F Instruction for Creating or Updating a File</B>
<A NAME="IDX4063"></A>
<A NAME="IDX4064"></A>
<A NAME="IDX4065"></A>
<A NAME="IDX4066"></A>
<A NAME="IDX4067"></A>
<A NAME="IDX4068"></A>
<A NAME="IDX4069"></A>
<P>The <B>F</B> instruction in a <B>package</B> configuration file
creates or updates a file on the local disk by copying in the contents of the
indicated source file, which can reside in AFS or on the local disk. If
the <B>package</B> command interpreter cannot access the source file, it
exits without executing any instruction in the configuration file.
<P>If a file with the same name already exists on disk, the <B>package</B>
command overwrites it with the contents of the source file, unless the
<B>I</B> update code is used to prevent that. To add a
<B>.old</B> extension to the current version of the file, include
the <B>O</B> update code. To have the machine reboot automatically
after the <B>package</B> program completes, include the <B>Q</B>
update code.
<P>If a symbolic link, directory, or other element on the local disk has the
same name, it is replaced with the file (a directory's contents are first
removed as necessary).
<P>The instruction has the following syntax:
<PRE> <B>F</B>[<VAR>update_code</VAR>] <VAR>file</VAR> <VAR>source_file</VAR> [<VAR>owner group mode_bits</VAR>]
</PRE>
<P>where
<DL>
<P><DT><B>F
</B><DD>Indicates the creation or update of a file. It must be a capital
letter.
<P><DT><B><VAR>update_code</VAR>
</B><DD>Modulates the file creation instruction. It is optional and follows
the letter <B>F</B> directly, without an intervening space. Choose
one or more of the four acceptable values, and list them in any order:
<DL>
<P><DT><B>A
</B><DD>Indicates that the pathname in the <VAR>source_file</VAR> field is the
complete pathname of the source file, including the filename. If this
argument is omitted, the <B>package</B> command appends the pathname in
the <VAR> file</VAR> field to the pathname in the <VAR>source_file</VAR> field to
derive the source file's full name. This code allows the source
and target filenames to differ.
<P><DT><B>I
</B><DD>Preserves the existing file called <VAR>file</VAR>, rather than overwriting
it.
<P><DT><B>O
</B><DD>Saves the existing version of the file by appending a
<B>.old</B> extension to it.
<P><DT><B>Q
</B><DD>Causes the <B>package</B> command to exit with status code
<B>4</B> if it overwrites the file. If the standard
<B>package</B>-related changes have been made to the machine's AFS
initialization file, then status code <B>4</B> causes the machine to
reboot automatically. Use this code when the machine must reboot if
updates to the file are to have any effect (for example, if the operating
system file--<B>/vmunix</B> or equivalent--has changed).
</DL>
<P><DT><B><VAR>file</VAR>
</B><DD>Specifies the complete pathname on the local disk of the file to create or
update, including the filename as the final element.
<P><DT><B><VAR>source_file</VAR>
</B><DD>Specifies the pathname (local or AFS) of the file to copy to the local
disk.
<P>If the <B>A</B> update code is included, specify the source file's
complete pathname. Otherwise, the <B>package</B> command derives
the source file's full name by appending the <VAR>file</VAR> pathname to
this pathname. For example, if the <B>A</B> update code is not
included and the file <B>/afs/abc.com/rs_aix42/bin/grep</B> is the
source file for the <B>/bin/grep</B> binary, the proper value in this
field is <B>/afs/abc.com/rs_aix42</B>.
<P><DT><B><VAR>owner</VAR>
</B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
the file's owner in the output from the UNIX <B>ls -l</B>
command.
<P>To copy the source file's owner to the target file, leave this field
empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR> fields
must also be empty.
<P><DT><B><VAR>group</VAR>
</B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
the file's group in the output from the UNIX <B>ls -lg</B>
command.
<P>To copy the source file's group to the target file, leave this field
empty. In this case, the <VAR> owner</VAR> and <VAR>mode_bits</VAR> fields
must also be empty.
<P><DT><B><VAR>mode_bits</VAR>
</B><DD>Defines the file's UNIX mode bits. Acceptable values are the
standard three- or four-digit numbers corresponding to combinations of
permissions. Examples: <B>755</B> corresponds to
<B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
<P>To copy the source file's mode bits to the target file, leave this
field empty. In this case, the <VAR>owner</VAR> and <VAR>group</VAR> fields
must also be empty.
</DL>
<P><B>The L Instruction for Creating a Symbolic Link</B>
<A NAME="IDX4070"></A>
<A NAME="IDX4071"></A>
<A NAME="IDX4072"></A>
<A NAME="IDX4073"></A>
<A NAME="IDX4074"></A>
<A NAME="IDX4075"></A>
<A NAME="IDX4076"></A>
<P>The <B>L</B> instruction in a <B>package</B> configuration file
creates a symbolic link on the local disk to a directory or file that exists
either in AFS or elsewhere on the local disk. As with the standard UNIX
<B>ln -s</B> command, the link is created even if the actual file or
directory does not exist.
<P>If a file or directory on the local disk already has the same name, the
<B>package</B> command replaces it with a symbolic link.
<P>The instruction has the following syntax:
<PRE> <B>L</B>[<VAR>update_code</VAR>] <VAR>link</VAR> <VAR>actual_path</VAR> [<VAR>owner group mode_bits</VAR>]
</PRE>
<P>where
<DL>
<P><DT><B>L
</B><DD>Indicates the creation of a symbolic link. It must be a capital
letter.
<P><DT><B><VAR>update_code</VAR>
</B><DD>Modulates the link creation instruction. It is optional and follows
the letter <B>L</B> directly, without an intervening space. Choose
one or both of the acceptable values, and list them in any order:
<DL>
<P><DT><B>A
</B><DD>Indicates that the pathname in the <VAR>actual_path</VAR> field is the
complete pathname of the actual directory or file (including the filename for
a file). If this argument is omitted, the <B>package</B> command
appends the value in the <VAR>link</VAR> field to the pathname in the
<VAR>actual_path</VAR> field to derive the actual directory or file's full
name. This code allows the name of the symbolic link and actual
directory or file to differ.
<P><DT><B>I
</B><DD>Preserves the existing symbolic link called <VAR>link</VAR>, rather than
overwriting it.
</DL>
<P><DT><B><VAR>link</VAR>
</B><DD>Specifies the complete local disk pathname of the symbolic link to
create.
<P><DT><B><VAR>actual_path</VAR>
</B><DD>Specifies the pathname (local or AFS) of the directory or file to which
the link refers. If the <B>A</B> update code is included, specify
the directory or file's complete pathname. Otherwise, the
<B>package</B> command derives the actual directory or file's full
name by appending the value in the <VAR>link</VAR> field to this
pathname. For example, if the <B>A</B> update code is not included
and <B>/etc/ftpd</B> is a symbolic link to the file
<B>/afs/abc.com/sun4x_56/etc/ftpd</B>, the proper value in this
field is <B>/afs/abc.com/sun4x_56</B>.
<P>The <B>package</B> command interpreter correctly handles pathnames that
begin with the <B>./</B> (period, slash) or
<B>../</B> (two periods, slash) notation, interpreting them
relative to the current working directory from which the <B>package</B>
command is invoked.
<P><DT><B><VAR>owner</VAR>
</B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
the symbolic link's owner in the output from the UNIX <B>ls -l</B>
command.
<P>To designate the issuer of the <B>package</B> command (usually, the
local superuser <B>root</B>) as the symbolic link's owner, leave this
field empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR>
fields must also be empty.
<P><DT><B><VAR>group</VAR>
</B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
the link's group in the output from the UNIX <B>ls -lg</B>
command.
<P>To have the symbolic link's group match the default group associated
with the <B>package</B> command's issuer, leave this field
empty. The issuer is usually the local superuser <B>root</B> and
the default group is designated in the issuer's entry in the local
<B>/etc/passwd</B> file or equivalent. If this field is left empty,
the <VAR>owner</VAR> and <VAR>mode_bits</VAR> fields must also be empty.
<P><DT><B><VAR>mode_bits</VAR>
</B><DD>Defines the symbolic link's UNIX mode bits. Acceptable values
are the standard three- or four-digit numbers corresponding to combinations of
permissions. Examples: <B>755</B> corresponds to
<B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
<P>Leaving this field empty sets the symbolic link's mode bits to
<B>777</B> (<B>rwxrwxrwx</B>). In this case, the <VAR>owner</VAR>
and <VAR>group</VAR> fields must also be empty.
</DL>
<P><B>The S Instruction for Creating a Socket</B>
<A NAME="IDX4077"></A>
<A NAME="IDX4078"></A>
<A NAME="IDX4079"></A>
<A NAME="IDX4080"></A>
<A NAME="IDX4081"></A>
<A NAME="IDX4082"></A>
<A NAME="IDX4083"></A>
<P>The <B>S</B> instruction in a <B>package</B> configuration file
creates a socket (a communications device for UDP or TCP/IP connections) on
the local disk. The instruction has the following syntax:
<PRE> <B>S</B> <VAR>socket</VAR> [<VAR>owner group mode_bits</VAR>]
</PRE>
<P>where
<DL>
<P><DT><B>S
</B><DD>Indicates the creation of a socket. It must be a capital
letter.
<P><DT><B><VAR>socket</VAR>
</B><DD>Names the socket. The proper format depends on the local
machine's operating system.
<P><DT><B><VAR>owner</VAR>
</B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
the socket's owner in the output from the UNIX <B>ls -l</B>
command.
<P>To designate the issuer of the <B>package</B> command (usually, the
local superuser <B>root</B>) as the socket's owner, leave this field
empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR> fields
must also be empty.
<P><DT><B><VAR>group</VAR>
</B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
the socket's group in the output from the UNIX <B>ls -lg</B>
command.
<P>To have the symbolic link's group match the default group associated
with the <B>package</B> command's issuer, leave this field
empty. The issuer is usually the local superuser <B>root</B> and
the default group is designated in the issuer's entry in the local
<B>/etc/passwd</B> file or equivalent. If this field is left empty,
the <VAR>owner</VAR> and <VAR>mode_bits</VAR> fields must also be empty.
<P><DT><B><VAR>mode_bits</VAR>
</B><DD>Defines the socket's UNIX mode bits. Acceptable values are the
standard three- or four-digit numbers corresponding to combinations of
permissions. Examples: <B>755</B> corresponds to
<B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
<P>Leaving this field empty sets the symbolic link's mode bits to
<B>777</B> (<B>rwxrwxrwx</B>), modulated by the cell's
umask. In this case, the <VAR>owner</VAR> and <VAR>group</VAR> fields must
also be empty.
</DL>
<P><B>The %define or %undef Instructions Declaring or Undeclaring a
Definition</B>
<A NAME="IDX4084"></A>
<A NAME="IDX4085"></A>
<A NAME="IDX4086"></A>
<A NAME="IDX4087"></A>
<A NAME="IDX4088"></A>
<A NAME="IDX4089"></A>
<P>The <B>%define</B> instruction in a <B>package</B> configuration
file declares or defines a variable, depending on its number of
arguments:
<UL>
<P><LI>If followed by a single argument, it declares that argument to be
defined. The argument is then available as a controller when mentioned
in <B>%ifdef</B> and <B>%ifndef</B> statements, which evaluate to
<B>true</B> and <B>false</B> respectively.
<P><LI>If followed by two arguments, it defines the second argument as the value
of the first. When the first argument appears later in this prototype
or other prototype or library files as a variable--surrounded by curly
braces and preceded by a dollar sign, as in the example
<TT>${variable}</TT>--the <B>package</B> command interpreter
substitutes the second argument for it.
</UL>
<P>The <B>%undef</B> statement negates the effect of a previous
<B>%define</B> statement, declaring its argument to be defined no longer,
or to have a value no longer if it is a variable.
<P>The syntax for the two types of instruction are as follows:
<PRE> %define <VAR>declaration</VAR>
%define <VAR>variable</VAR> <VAR>value</VAR>
%undef <VAR>declaration</VAR>
%undef <VAR>variable</VAR>
</PRE>
<P>where
<DL>
<P><DT><B>%define
</B><DD>Indicates a definition statement.
<P><DT><B>%undef
</B><DD>Indicates a statement that negates a definition.
<P><DT><B><VAR>declaration</VAR>
</B><DD>Names the string being declared by a <B>%define</B> statement, or
negated by an <B>%undef</B> statement.
<P><DT><B><VAR>variable</VAR>
</B><DD>Specifies the name of the variable that a <B>%define</B> statement is
defining, or an <B>%undef</B> statement is negating.
<P><DT><B><VAR>value</VAR>
</B><DD>Specifies the value to substitute for the string in the <VAR>variable</VAR>
field when it appears in the appropriate format (surrounded by curly braces
and preceded by a dollar sign, as in the example <TT>${variable}</TT>), in
this or other prototype and library files. It can include one or more
words.
</DL>
<P><B>The %ifdef and %ifndef Instructions for Specifying a Conditional
Action to Perform</B>
<A NAME="IDX4090"></A>
<A NAME="IDX4091"></A>
<A NAME="IDX4092"></A>
<A NAME="IDX4093"></A>
<A NAME="IDX4094"></A>
<A NAME="IDX4095"></A>
<P>The <B>%ifdef</B> instruction in a <B>package</B> configuration
file specifies one or more actions to perform if the indicated string has been
declared by a single-argument <B>%define</B> statement, or is a variable
for which a value has been defined by a two-argument <B>%define</B>
statement.
<P>Similarly, the <B>%ifndef</B> instruction specifies one or more actions
to perform if the indicated string has not been declared or is a variable
without a value, either because no <B>%define</B> statement has defined it
or an <B>%undef</B> statement has undefined it.
<P>In both cases, the optional <B>%else</B> statement specifies one or
more alternate actions to perform if the first statement evaluates to
<B>false</B>. (For an <B>%ifdef</B> statement, the
<B>%else</B> statement is executed if the indicated string has never been
declared or is a variable without a value, or if an <B>%undef</B>
statement has undefined either one; for an <B>%ifndef</B> statement,
it is executed if the string has been declared or is a variable with a
value.)
<P>It is possible to nest any number of <B>%ifdef</B> and
<B>%ifndef</B> statements.
<P>The two types of statement share a common syntax:
<PRE> %ifdef | ifndef <VAR>declaration</VAR>
<VAR>action</VAR><SUP>+</SUP>
[%else [<VAR>declaration</VAR>]
<VAR>alternate_action</VAR><SUP>+</SUP>]
%endif <VAR>declaration</VAR>
</PRE>
<P>where
<DL>
<P><DT><B>ifdef
</B><DD>Indicates that the statement evaluates as <B>true</B> if the string in
the <VAR>declaration</VAR> field is declared or is a variable with a defined
value.
<P><DT><B>ifndef
</B><DD>Indicates that the statement evaluates as <B>true</B> if the string in
the <VAR>declaration</VAR> field is not declared or is a variable without a
defined value.
<P><DT><B><VAR>declaration</VAR>
</B><DD>Specifies the string that must be declared or the variable name that must
have a defined value for an <B>%ifdef</B> statement to evaluate as
<B>true</B>, which results in the specified action being performed.
For an <B>%ifndef</B> statement, the string must not be declared or the
variable must have no defined value for the statement to evaluate as
<B>true</B>. The first and third occurrences of
<VAR>declaration</VAR> (the latter following the string <B>%endif</B>) are
required. The second occurrence (following the string <B>%else</B>)
is optional, serving only to clarify to which <B>%ifdef</B> or
<B>%ifndef</B> statement the <B>%else</B> statement belongs.
<P><DT><B><VAR>action</VAR>
</B><DD>Specifies each action to perform if the <B>%ifdef</B> or
<B>%ifndef</B> statement evaluates as <B>true</B>. Each action
must appear on a separate line. Acceptable types of actions are other
statements beginning with a percent sign and definition instructions.
<P><DT><B><VAR>alternate_action</VAR>
</B><DD>Specifies each action to perform if the <B>%ifdef</B> or
<B>%ifndef</B> statement evaluates to <B>false</B>. Each action
must appear on a separate line. Acceptable types of actions are other
statements beginning with a percent sign and definition instructions.
</DL>
<P><B>The %include Instruction for Including a Library File</B>
<A NAME="IDX4096"></A>
<A NAME="IDX4097"></A>
<A NAME="IDX4098"></A>
<P>The <B>%include</B> instruction in a <B>package</B> configuration
file includes the contents of the indicated library file in a configuration
file that results from the compilation of the prototype file in which the
<B>%include</B> instruction appears. It has the following
syntax:
<PRE> %include <VAR>pathname</VAR>
</PRE>
<P>where
<DL>
<P><DT><B>%include
</B><DD>Indicates a library file include statement.
<P><DT><B><VAR>pathname</VAR>
</B><DD>Specifies the complete pathname of the library file to include. It
can be in AFS or on the local disk, and can include one or more
variables.
</DL>
<P><STRONG>Cautions</STRONG>
<P>The configuration file must be completely correct. If there are any
syntax errors or incorrect values, the <B>package</B> command interpreter
exits without executing any instruction.
<P><STRONG>Examples</STRONG>
<P>The following example <B>B</B> and <B>C</B> instructions define a
disk <B>/dev/hd0a</B> with major and minor device numbers <B>1</B> and
<B>0</B> and mode bits of <B>-rw-r--r--</B>, and a tty
<B>/dev/ttyp5</B> with major and minor device numbers <B>6</B> and
<B>5</B> and mode bits of <B>-rw-rw-rw</B>. In both cases, the
owner is <B>root</B> and the owning group <B>wheel</B>.
<PRE> B /dev/hd0a 1 0 root wheel 644
C /dev/ttyp5 6 5 root wheel 666
</PRE>
<P>The following example <B>D</B> instruction creates the local
<B>/usr</B> directory with owner <B>root</B> and group
<B>wheel</B> and mode bits of <B>drwxr-xr-x</B>. The
<B>R</B> update code removes any files and subdirectories that reside in
the <B>/usr</B> directory (if it already exists) but do not appear in the
configuration file.
<PRE> DR /usr root wheel 755
</PRE>
<P>The following example <B>F</B> instruction, appropriate for a machine
running AIX 4.2 in the ABC Corporation cell, creates or updates the
local disk file <B>/bin/grep</B>, using
<B>/afs/abc.com/rs_aix42/bin/grep</B> as the source.
<PRE> F /bin/grep /afs/abc.com/rs_aix42 root wheel 755
</PRE>
<P>The next example <B>F</B> instruction creates the
<B>/usr/vice/etc/ThisCell</B> file and specifies an absolute pathname for
the source file, as indicated by the <B>A</B> update code. The
<B>Q</B> code makes the <B>package</B> command return status code 4 as
it exits, prompting a reboot of the machine if the standard
<B>package</B>-related changes have been made to the machine's AFS
initialization file. No values are provided for the owner, group and
mode bits, so the file inherits them from the source file.
<PRE> FAQ /usr/vice/etc/ThisCell /afs/abc.com/common/etc/ThisCell
</PRE>
<P>The following example <B>L</B> instruction, appropriate for a machine
running AIX 4.2 in the ABC Corporation cell, creates a symbolic link
from <B>/etc/ftpd</B> on the local disk to the file
<B>/afs/abc.com/rs_aix42/etc/ftpd</B>.
<PRE> L /etc/ftpd /afs/abc.com/rs_aix42 root wheel 644
</PRE>
<P>The following example <B>S</B> instruction defines the socket
<B>/dev/printer</B>.
<PRE>
S /dev/printer root wheel 777
</PRE>
<P>The following example <B>%define</B> instruction defines the value for
the variable <TT>${diskmode}</TT>. This variable is used elsewhere in
the template to fill the <VAR>owner_name</VAR>, <VAR>group_name</VAR>, and
<VAR>mode_bits</VAR> fields in a <B>D</B>, <B>F</B>, or <B>L</B>
instruction.
<PRE> %define diskmode root wheel 644
</PRE>
<P>The following example <B>%undef</B> instruction declares the string
<B>afsd</B> not to be defined.
<PRE> %undef afsd
</PRE>
<P>The following example <B>%ifdef</B> instruction specifies that if the
string <TT>rs_aix42</TT> is currently declared, then when the prototype file
containing the instruction is compiled the three indicated library files are
included. There is no alternate action defined. There must be
<B>%define</B> statements earlier in the prototype file to declare
<B>rs_aix42</B> and to assign a value to the <TT>${wsadmin}</TT>
variable.
<PRE> %ifdef rs_aix42
%include ${wsadmin}/lib/rs_aix42.readonly
%include ${wsadmin}/lib/rs_aix42.generic
%include ${wsadmin}/lib/rs_aix42.generic.dev
%endif rs_aix42
</PRE>
<P>The following example <B>%ifndef</B> instruction, appropriate for the
State University cell, defines <TT>stateu.edu</TT> as the value of
the <TT>${cell}</TT> variable if it does not already have a value.
<PRE> %ifndef cell
%define cell stateu.edu
%endif cell
</PRE>
<P>The following example <B>%include</B> instruction includes the library
file <B>base.generic</B> from the <B>lib</B> subdirectory of
the directory in which <B>package</B>-related files reside. The
<TT>${wsadmin}</TT> variable resolves to an actual pathname (such as
<B>/afs/abc.com/wsadmin</B>) during compilation.
<PRE> %include ${wsadmin}/lib/base.generic
</PRE>
<P><STRONG>Related Information</STRONG>
<P><A HREF="auarf204.htm#HDRPACKAGE">package</A>
<P>
<HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf052.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Top_Of_Page"><IMG SRC="../top.gif" BORDER="0" ALT="[Top of Topic]"></A> <A HREF="auarf054.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P>
<!-- Begin Footer Records ========================================== -->
<P><HR><B>
<br>&#169; <A HREF="http://www.ibm.com/">IBM Corporation 2000.</A> All Rights Reserved
</B>
<!-- End Footer Records ============================================ -->
<A NAME="Bot_Of_Page"></A>
</BODY></HTML>