[Top] [Prev] [Next] [Contents] [Index]

Configuring How a Terminal Accesses Files

This section describes accessing files (other than the X server file) that are located on a network host. For information on local file service (accessing files on a PCMCIA card or local diskette), see the System Administrator's Guide.

Configuring the Initial File Servers

The initial file servers are used for loading configuration files, fonts, and the rgb.txt file when the terminal boots and for accessing files while the terminal is running. The initial file servers are automatically entered into the file service table described in "Configuring the File Service Table".

The file-initial-server-1 and file-initial-server-2 remote configuration parameters permit you to define the primary and secondary initial file servers (Setup -> Change Setup Parameters -> File Service -> Initial File Server 1, Initial File Server 2).

The file-initial-protocol-1 and file-initial-protocol-2 parameters specify the file access method for the initial file servers (Setup -> Change Setup Parameters -> Initial Protocol 1, Initial Protocol 2). The default file access protocol is TFTP. All of these parameters can be saved in NVRAM.

If you specify both file servers and the primary server is not available, the terminal tries to load its configuration file from the secondary server.

If one of the initial file servers is set to IP address 0.0.0.0, the boot host is used as the file server and is automatically entered into the file service table. Normally, you cannot use the boot host for both initial file servers. If the IP addresses of both initial file servers are set to 0.0.0.0, the secondary initial file server is ignored unless they are using different file service protocols.

Table 5-14 file-initial-server-1 Parameter
Possible Values
Result
default 0.0.0.0
0.0.0.0 The boot host is the initial file server.
IP address or hostname The primary initial file server.

Table 5-15 file-initial-server-2 Parameter
Possible Values
Result
default 0.0.0.0
0.0.0.0 The boot host is the secondary file server.
IP address or hostname The secondary initial file server.

Table 5-16 file-initial-protocol-1 Parameter
Possible Values
Result
default tftp
tftp Use the TFTP protocol for file access.
nfs Use NFS for file access (using the UDP protocol).
nfs/tcp Use NFS for file access (using the TCP protocol).
ncdnet Use DAP for file access.

Table 5-17 file-initial-protocol-2 Parameter
Possible Values
Result
default tftp
tftp Use the TFTP protocol for file access.
nfs Use NFS for file access (using the UDP protocol).
nfs/tcp Use NFS for file access (using the TCP protocol).
ncdnet Use DAP for file access.

Configuring the File Service Table

After loading an X server, the terminal uses its file service table, defined in the file-service-table parameter, for all file access (Setup -> Change Setup Parameters -> File Service -> File Service Table). This table maps the default file locations known to the X server to the actual locations of files on file server hosts. The entries in each row of the file service table are described in Table 5-19.

By default, the terminal uses the boot host as the initial file server on which it searches for files (such as configuration files) during the booting process. After booting, the terminal also uses the boot host by default for all ongoing file requests.

If you have defined initial file servers, as explained in "Configuring the Initial File Servers", the initial file servers are automatically placed in the file service table. If the terminal is accessing files only from these hosts and the boot host and the files are in their default locations, no further configuration of the file service table is necessary.

If files required by the terminal are not on the boot host or designated initial file servers or are not in their default locations, configure the file service table to map the default file access points known by the X server to the actual file access points and actual host.

The default file locations known to the X server are listed in Table 5-18.

Table 5-18 Default File Locations
File Type
Default Directory
Remote configuration files /usr/lib/X11/ncd/configs
Color definition file (rgb.txt) /usr/lib/X11/ncd
Fonts /usr/lib/X11/ncd/fonts
Diagnostic log file No default location
Keysym file (XKeysymDB) /usr/lib/X11/ncd

Each entry in the table specifies a file server host, the file access point used by the terminal, the actual file access point on the file server, the protocol used, the retransmission and transaction timeout periods, and the amount of data transmitted on each read and write operation.

To change the file access point and the host:

  1. Find the entry in the file-service-table parameter (see Table 5-19) that has the default location in the local-unix-mount-point field. For example, if you are placing the remote configuration files in a non-standard location, look for the default location /usr/lib/X11/ncd/configs in the local-unix-mount-point field. (In Setup -> Change Setup Parameters -> File Service -> File Service Table, look for Local UNIX Mount Point with the default location.)

  2. In the server mount point field, enter the actual file access point on the host. (In the File Service Table, click on the Server Mount Point entry you want to change, then type the actual file access point in the text entry box.)

  3. If the actual file access point is on a host other than the boot host or an initial file server, enter the name or IP address of the host in the server field. (In the File Service Table, click on the Server entry you want to change, then type the name or IP address of the host in the text entry box.)

    Note:
    Local file systems are not entered into the file service table.

Table 5-19 file-service-table Parameter
Table Entries
Possible Values
Result
local-unix-mount-point default nil
pathname The terminal's local UNIX-style pathname for this file service access point.
local-vms-mount-point default nil
pathname The terminal's local VMS-style pathname for this file service access point.
server default nil
network address or hostname The file server host.
protocol default tftp
tftp TFTP is used for accessing files through this access point.
nfs NFS/UDP is used for accessing files through this mount point.
nfs/tcp NFS/TCP is used for accessing files through this mount point.
ncdnet NCDnet is used for accessing files through this mount point.
server-mount-point default nil
pathname Pathname for this file service access point on the file server host.
file-name-type (This field is not used
if the protocol field
is "nfs" or "nfs/tcp.")
default unknown
unknown This value works for TFTP or DAP.
unix The file server uses UNIX-style filenames.
vms The file server uses VMS-style filenames.
retransmission-timeout default 3
integer The amount of time (in seconds) between successive transmissions of a file service request. This is only used with file service protocols running over connectionless transports (for example, NFS or TFTP).
Range: 0 - 4294967295.
transaction-timeout default 30
integer The amount of time (in seconds) to attempt a file service request before a failure situation is declared. Range: 0 - 4294967295.
read-size 1 default 8192
integer The amount of data (in bytes) requested in a single read request from the terminal. This parameter is used with NFS, NFS/TCP, and TFTP. Values below 512 bytes cause noticeably slow performance. Range: 0 - 8192.
write-size 1 default 8192
integer The amount of data (in bytes) requested in a single write request from the terminal. This parameter is only used with NFS or NFS/TCP. Values below 512 bytes cause noticeably slow performance. Range: 0 - 8192.

1 If the terminal is having trouble reading files with NFS across gateways, try decreasing read-size and write-size to 1024 bytes.

An example file service table follows:


file-service-table = {
     {/usr/lib/X11/ncd/ nil eagle tftp /usr/local/lib/X11/ncd/ unknown 3 
30 8192 8192}
     {/var/tmp nil eagle nfs /var/tmp unknown 3 30 8192 8192}
     }

Configuring the Matching Method

When attempting a file access, the terminal compares the file request with the local mount points in the file service table. By default, the terminal tries only the longest matching pathname (or pathnames, if there are matches of equal length). The longest match is the most complete match, the one that matches most or all of the elements in the pathname. You can configure the terminal to try all matching pathnames instead.

The file-try-all-matches-on-open parameter (Setup -> Change Setup Parameters -> File Service -> Try All Matches on Open) controls how the terminal uses file service table entries when trying to access a file.

Table 5-20 file-try-all-matches-on-open Parameter
Possible Values
Result
default false
false The terminal tries only the longest matches.
true The terminal tries all matching pathnames, beginning with the longest match.

The two methods of matching are explained in more detail in the following subsections.

Trying Only the Longest Matches

By default, the terminal tries only the longest matches. For example, assume that the pathname of a font requested by a client program is /usr/lib/X11/ncd/fonts/pcf/100dpi/10x20.pcf, and the file service table contains the following local mount points:


/usr/lib/X11/ncd
/usr/lib/X11/ncd
/usr/lib/X11/ncd
/usr

The first three local mount points match the request. The terminal tries the hosts in the order in which they are listed in the file service table, until it succeeds in opening the font file.

You may wish to have several longest matches to ensure that the terminal can always find the font or other data it needs.

Trying All Matches

If the terminal is configured to try all matches, the terminal first finds all the matches. After finding all the matching paths, the terminal sorts the mount points by length and tries the longest path first. If the file is not found there, the next longest is tried and so on. The root directory ( / ) matches any request.

For example, assume that the pathname requested by a client program is /usr/lib/X11/ncd/fonts/100dpi/10x20.snf, and the following local mount points are in the file service table:


/usr/lib/X11/ncd/fonts/100dpi
/usr/lib/X11/ncd/fonts
/usr/lib/X11/ncd
/usr
/
/ncd

The first five mount points match this request and the terminal.

Configuring File Access through TFTP

Terminals can use TFTP to download the X server and other files at boot and for ongoing file access.

NCD does not recommend using TFTP for writing to diagnostic log files.

TFTP is implemented by a daemon program, tftpd(8), and configured in the boot host's /etc/inetd.conf file.

Secure versus Non-Secure TFTP

TFTP can run in two modes: secure mode (also called restricted mode) and non-secure mode.

Secure (Restricted) TFTP

Secure TFTP enhances security because it requires that the host perform a change root operation (chroot[8]) to the directory specified when TFTP is invoked. The directory specified when TFTP is invoked is TFTP's default home directory (usually /tftpboot). Because of the chroot, all files to be accessed using secure TFTP (including X servers, fonts, and remote configuration files) must be physically installed under the directory and in the same file system partition. Symbolic links do not work.

If installing all files in the secure directory makes the directory too large, you can mount a file system partition, using the secure directory as the mount point. You could also use the secure directory only for X servers and use NFS as the access method for other files and fonts.

Non-Secure TFTP

Use non-secure TFTP when extra security is unnecessary. Non-secure TFTP is more flexible because chroot is not used. With non-secure TFTP, you can put X servers and modules in any directory. Note that when you use a non-standard directory for the X server or server modules, you must configure the terminal to find the files and configure the booting process to place the X server and modules in the desired location(s).

Make Sure TFTP Is Enabled on the Host

Consult your vendor documentation on how to make sure that TFTP is enabled. On some systems, you can use the following procedure:

  1. Make sure the tftpd daemon has been installed and enabled. Usually, the daemon is enabled in the file /etc/inetd.conf; for example:

    tftp dgram udp wait root /usr/etc/in.tftpd in.tftpd

    If a comment symbol (#) appears at the beginning of the entry, remove it. Always specify "wait" instead of "no wait." Otherwise, each tftpd request starts a new process, which can cause the host to start processes until it cannot start any more. If you specify "wait," each request is processed before another is serviced.


    Usually, tftpd runs under the user ID root as indicated in the example command line.

  2. Make sure that the X server and module directories and other required files are world-readable.

  3. If you make any changes to the /etc/inetd.conf file, restart the inetd daemon to force it to reread the configuration file and start tftpd running.You can restart the daemon by finding its process id and sending it a hangup signal. For example:

    # ps -acx | grep inetd
    17601 ?  I 0:12 inetd
    # kill -HUP 17601
    

    On some systems, the command is ps -ef | grep inetd.

  4. If you are using secure TFTP, make sure that all files to be accessed through TFTP are installed in the directory specified by the TFTP entry in the /etc/inetd.conf file. For example, on SunOS systems, the enabling line in /etc/inetd.conf for secure TFTP is:

    tftp dgram udp wait root /usr/etc/in.tftpd in.tftpd -s /tftpboot

    This line makes it impossible for the NCD terminal to access fonts and configuration files because secure TFTP cannot reach /usr/lib/X11/ncd. This directory is outside the secure directory, which TFTP treats as its root (/) directory. One solution is to change -s /tftpboot to -s /usr/tftpboot. Restart the inetd daemon as directed in
    Step 3. Then move the X servers to /usr/tftpboot and move /usr/lib/X11/ncd to /usr/tftpboot/usr/lib/X11/ncd.

On HP-UX systems after Version 7, TFTP is secure; the TFTP daemon's home directory is the secure directory /usr/tftpdir. Any files that the terminal accesses via TFTP should be placed in this directory.

Configuring File Access through NFS

The terminal can use NFS for accessing all files and for downloading an X server. When accessing files through NFS, the X server temporarily mounts the file system onto its internal path.

Configuring the Host for NFS File Access

For files to be available through NFS, the host directories must be exported. This ensures that NFS clients, such as NCD terminals, can access the directories.

For example, on SunOS:

  1. To export the default directory for X server files, add a line describing the directory in the /etc/exports file. For example:

    /tftpboot/

    or


    /usr/tftpboot

    Files can be exported to specific terminals, exported to everyone, or exported to unknown, the default name for an NCD terminal.

  2. On the host where the directory resides, enter the following command:

    # exportfs -a

Setting User and Group IDs for NFS File Access

If the host exporting the file systems restricts mount requests to certain user or group IDs, set the file-nfs-uid and file-nfs-gid parameters to the relevant user ID (UID) and group ID (GID). These parameters are not available in the Setup menus.

The default value for both parameters is "-2", which corresponds to nobody. NFS handles requests that do not have a valid UID and GID by mapping them to the anonymous user. By default, the anonymous user is nobody. With user and group IDs of -2, files and directories must be world-readable and world-writable.

Table 5-21 file-nfs-uid Parameter
Possible Values
Result
default -2
-2 Access is the same as the world permissions.
integer The user ID of the requestor.

Table 5-22 file-nfs-gid Parameter
Possible Values
Result
default -2
-2 Access is the same as the world permissions.
integer The group ID of the requestor.

Setting the Unmount Timer for NFS File Access

The file-nfs-unmount-timeout parameter (Setup -> Change Setup Parameters -> File Service -> NFS Unmount Timeout) controls how long to wait before unmounting file systems because of inactivity. The default is 1800 seconds (30 minutes). An unmounted file system is remounted the next time the terminal tries to access a file.

Table 5-23 file-nfs-unmount-timeout Parameter
Possible Values
Result
default 1800
integer Timeout (in seconds) before file systems are unmounted due to inactivity. Range: 1 - 3600.

Changing the Timeout for Failed File Servers

The file-failed-server-ignore-timeout parameter (Setup -> Change Setup Parameters -> File Service -> Failed Server Ignore Timeout) controls how long the terminal ignores a file server that has failed because of a network timeout error. When the terminal attempts to open a new file, it skips over the ignored servers.

The default timeout period is 120 seconds. A long timeout speeds up booting and session reset when the primary initial file server has failed.

Table 5-24 file-failed-server-ignore-timeout Parameter
Possible Values
Result
default 120
integer The amount of time (in seconds) to ignore a file server that has failed because of a network timeout error.
Range: 1 - 600.

Issuing Extended File Service Diagnostic Messages

The file-extended-diagnostics parameter (Setup -> Change Setup Parameters -> File Service -> Extended Diagnostics) controls the extent of the file service diagnostics messages issued by the terminal. By default, a minimum number of messages are issued.

If you are having problems with the terminal accessing files, you can arrange to display more specific messages by setting this parameter to "true."

Table 5-25 file-extended-diagnostics Parameter
Possible Values
Result
default false
false Minimal file service diagnostic messages are issued.
true Extended file service diagnostic messages are issued.



[Top] [Prev] [Next] [Contents] [Index]

Send comments, suggestions, or questions about this document to the NCD Technical Publications Department by Internet e-mail. Write to us at techpubs@ncd.com.
Copyright © 1997, NCD Inc. All rights reserved.