netdistd(1M)
NAME
netdistd − network file distribution (update) server daemon
SYNOPSIS
/etc/netdistd [−C connections] [−f file] [−l] [−L logfile] [−P port] [−v] [−c directory]
DESCRIPTION
netdistd is the server daemon for the “netdist” file distribution service. The netdist service supports the distribution of packages, basically collections of files, from a server system (host) to a client system (host). Currently, update(1M) is available as a netdist client.
Options
The options are:
−C connections Set maximum allowable number of simultaneous connections (default is 20).
−f file Use file as the central package definition file instead of the default file (see FILES below). Use this option to “connect” netdistd to a non-default directory tree.
−l Append event information to the default log file (see FILES below). The netdistd command does no logging unless this option or −L is specified. netdistd seeks to the end of the log file before each write to it, making it safe to truncate the logfile while the daemon is running.
−L logfile Activate logging but use logfile instead of the default log file. If logfile is −, netdistd runs in the foreground (does not detach from the display), and logging goes to standard output.
−P port Specify the port number to use instead of the default port number associated with the netdist service in the network services file (see FILES below).
−v Trace package execution (verbose logging). This option is ignored unless −l or −L is also specified. Repeating −v up to 6 times increases the relative amount of verbosity.
−c directory Specify a directory to hold temporary subdirectories for caching information files for efficient transfer to update(1M). By default the temporary subdirectories reside in the directory that contains the central package definition file. Specify directory as none to turn off the update(1M) information file caching feature.
Log Files
Each line in a log file begins with one of two kinds of identifiers:
netdistd.pid
counter.pid
Lines of the first form are emitted by the originally scheduled netdistd daemon and contain its process ID number. netdistd starts a new child process to handle each connection (service request). Lines of the second form are emitted by child processes and contain their process ID numbers. counter is a number incremented for each child process started by a server.
Control Signals
Once netdistd is running, you can send it one of the following signals using kill(1) to change its state:
SIGINT
SIGPIPE
SIGTERM If caching is enabled and any child processes are running (that is, connections spawned by this server are active), response to these signals (that is, termination of the parent server process) is delayed until all children terminate, and no new connections to the server are allowed until this occurs.
SIGHUP Re-read the package definition files. If logging is enabled, close and reopen the log file. If caching is enabled, remove and recreate the cached information files, but if any child processes of this server are running, all response to the signal is delayed until all of them terminate, and no new connections are allowed to this server until this occurs.
SIGQUIT Toggle logging off and on.
SIGUSR1 Increase the trace level by one.
SIGUSR2 Decrease the trace level by one.
Package Definition Files
Files available through the netdist service are bundled into “filesets” (see update(1M)). Each fileset has an associated “package definition file” stored in a fileset-dependent location (see FILES below). The package definition file is a netdistd control file that, among other things, specifies which files belong to the fileset. In addition, a central package definition file identifies the filesets that are available for distribution, and contains pointers to individual fileset package definition files.
When performing a network file distribution, netdistd reads the central package definition file (see FILES below) to determine what filesets are available from the server system and to obtain the pointer to the package definition file for each fileset to be distributed.
Temporary Subdirectories and Cached Files
The netdistd program creates temporary subdirectories containing cached update(1M) information files. By default the subdirectories are located under the directory containing the central package definition file.
This feature allows update(1M) and updist(1M) clients to get fileset information very quickly.
The temporary subdirectories and cached files are automatically removed when the netdistd parent process stops or is terminated. They are automatically removed and recreated when the netdistd parent process receives a SIGHUP signal, as part of re-reading the package definition files.
The subdirectories are named tmpport.arch, where port is the port number the server uses and arch is the architecture type of the filesets to which the cached information files correspond. For example, a netdistd program using port 2106 and serving Series 300/400, Series 700, and Series 600/800 filesets creates three subdirectories called tmp2106.300, tmp2106.700, and tmp2106.800.
Cached files consume about 700 bytes of disk space for each fileset served plus about 60 bytes of disk space for each file served. Typically this adds up to about 4Kbytes of temporary disk space for each fileset served. Viewed another way, the space used is about 0.3% of the total disk space for the served filesets.
If caching is disabled (see the −c option above), less disk space is used, but client processes take longer to get fileset information.
Setting Up a Network Distribution Server
When setting up a system to support the netdist service, follow these steps:
1. Use updist(1M) to load the desired filesets onto the server system. The recommended destination directory under which to load the filesets is the default, /netdist.
Directly below the destination directory, updist creates a central package definition file (see FILES below) containing a source statement for each distributable fileset. Commenting or uncommenting the source statements affects which filesets the server program can distribute (lines beginning with # are treated as comments in the usual manner).
Note: The rmfn(1M) and sysrm(1M) commands cannot remove netdist packages. To remove a package (fileset), edit the central package definition file to comment out or delete references to the deleted package, and send netdistd a SIGHUP signal. Then, if desired, run rm −r on the package’s directory under the updist destination directory to remove the package’s files. Warning: Don’t modify or delete the package’s files until all server child processes that might be using them complete.
2. Ensure that there is an entry for the netdist service in the networking services definition file (see FILES below). For example:
netdist 2106/tcp # network file distribution
3. Start the netdistd daemon by invoking it with any options desired. The netdistd command automatically starts a background process and returns control to the caller. netdistd can also be called from system start up scripts, but do not call it from init(1M) directly, because it appears to terminate immediately, possibly causing init to respawn it.
4. The server system is now ready for use by update(1M). To verify, run update interactively and specify the server system’s hostname as the update source. Verify that the available filesets correspond to those loaded on the server system. Another verification method is to run:
update −c −s hostname
on the server system and look for the desired filesets in the output.
Note: If the source is a netdist server system, update −c lists only those available filesets that match the client system’s architecture type. Use the update −S option to list the other type. For example, on a Series 600/800 system:
update −c −s hostname −S300
5. Set permissions for remote systems to access the network server (see Security section below).
Modifying a Network Distribution Server
The safest method is:
1. tail −f logfile This starts a continuous tail of the log file to your screen so you can see when netdistd terminates.
2. kill parent-server If clients are connected, the netdistd parent process delays terminating until any existing child processes terminate, and meanwhile new connections are refused.
3. Wait for the netdistd server to stop, watching the previously started tail of the logfile. Clients doing a full operating system update, and clients just sitting there with a selection screen (possibly forgotten by their creators), could make you wait a long time.
4. Add, modify, or delete filesets in the netdist tree.
5. Restart the netdistd server.
6. Kill the tail process you started in the background.
The riskier method of modifying a netdist server tree is:
1. Add, modify, or delete filesets in the netdist tree. (Only adding filesets is completely safe using this method.)
2. kill −1 parent-server If clients are connected, the netdistd parent process delays rereading the package description file and rebuilding cached files until all existing child processes terminate. Meanwhile, new connections are refused.
Security
Whenever the netdistd daemon receives a connection request, it performs a security check using the same mechanism as inetd(1M) (see inetd.sec(4)).
RETURN VALUE
The netdistd command returns 0 if it encounters no errors, and 1 otherwise.
DIAGNOSTICS
When invoked, netdistd parses and compiles the instructions contained in the package definition files. It then does an access check on the source files to be distributed. If an error occurs, netdistd prints an error message to the log file and halts.
EXAMPLES
Run netdistd with default connections limit, default central package definition file, default port number, and no logging:
netdistd
Run netdistd with a maximum of two simultaneous connections, an alternate central package definition file, very verbose logging to an alternate log file, and a special port number:
netdistd −C2 −f /netd2/MAIN.pkg −vvL /tmp/netdistd.log −P 2111
DEPENDENCIES
Series 700
For HP-UX release 8.01, there is little externally visible difference between Series 700 and Series 600/800 update media sub-tree names and structure. Consequently, if updist is used to create netdist servers for both Series 700 and Series 600/800 filesets, the filesets must be placed in separate destinations (netdist trees) so they do not overwrite each other. This can be done by, for example, sending the Series 700 filesets to a destination of /netdist.700. Files from Series 700 update media are then placed in a directory subtree named 800 under directory /netdist.700. Run separate netdistd programs on different ports for each tree. For example, to start a server for the /netdist.700 tree:
netdistd −f /netdist.700/MAIN.pkg −P 2107
For 8.05 and later releases of HP-UX, a separate destination (netdist tree) is not necessary. updist deposits filesets in a sub-tree under the netdist tree for each system type.
AUTHOR
netdistd was developed by HP.
FILES
/netdist/MAIN.pkg default central package definition file
/netdist/300/fileset-name/netdist.pkg Series 300/400 package definition files
/netdist/700/fileset-name/netdist.pkg Series 700 package definition files
/netdist/800/fileset-name/netdist.pkg Series 600/800 package definition files
/netdist/tmp2106.300
/netdist/tmp2106.700
/netdist/tmp2106.800 default temporary subdirectories for cached update(1M) information files
/usr/adm/netdist.log default log file
/etc/services networking services definition file; contains default port number
/usr/adm/inetd.sec inetd security file also read by netdistd
SEE ALSO
kill(1), inetd(1M), init(1M), rmfn(1M), sysrm(1M), update(1M), services(4), inetd.sec(4).
Hewlett-Packard Company — HP-UX Release 8.05: June 1991