LDM 6 Behavior


This page describes the behavior of the LDM 6 program.

Contents


Top-level ldmd behavior

When executed, the ldmd program does the following:

  1. If the LDM logfile is not standard error, then the program forks itself and the parent process terminates. The child process detaches itself from the process group of the parent process and becomes a process group leader.
  2. Initializes logging and logs a "Starting Up" message.

  3. Establishes an Internet port that will be used for incoming connections. If the program is set-uid-root, then the port number will be 388; otherwise, the port number will be decided by the operating system.

  4. Registers the LDM 5 and LDM 6 services with the RPC portmapper (if it is available) using the port number from the previous step.

  5. Reads the LDM configuration-file, ldmd.conf, and does the following:

  6. Goes into a loop in which it alternately


Upstream LDM 6.6 behavior

An upstream LDM does the following:

  1. Computes the intersection of the data-product selection-criteria contained in the FEEDME or NOTIFYME request and the criteria specified in the relevant ALLOW entry.

  2. If the intersection is empty, then then connection is closed and the process terminates; otherwise,

  3. If the intersection is not empty but also not equal the the original request, then the process informs the downstream LDM about the intersection and continues to listen; otherwise,

  4. The process acknowledges the request and begins sending matching data-products from the product-queue to the downstream LDM using the primary or alternate transfer-mode (for FEEDME requests) or NOTIFICATION messages (for NOTIFYME requests).

  5. If the process reaches the end of the product-queue, then it suspends itself for 30 seconds or until reception of a SIGCONT signal (from an ingester or downstream LDM) whichever occurs first.

  6. If nothing has been sent to the downstream LDM in 30 seconds, then the process sends a NULLPROC message.

Upstream LDM 6 behavior in primary mode

Upstream LDM 6 behavior in alternate mode

Downstream LDM 6 behavior

A downstream LDM does the following:

  1. Sets the initial data-product selection-criteria. The initial "start" time is set as follows:

  2. Obtains the metadata of the most recently-received data-product corresponding to the data-product selection-criteria. If the home-directory of the LDM user contains a metadata file corresponding to the data-request and the upstream LDM, then the metadata in that file is read and used; otherwise, the metadata of the most recent data-product in the product-queue that matches the data-product selection-criteria is used.

  3. Encodes into the data-request the data-product signature of the metadata from the previous step, if available, so that the upstream LDM can start sending data-products from where the previous downstream LDM left off.

  4. Enters a loop that terminates when a successful FEEDME request is made to the upstream LDM:

  5. Receives data-products over the connection contained in HEREIS or COMINGSOON and BLKDATA messages. When the product has completely arrived, it is inserted into the product-queue and a SIGCONT signal is then sent to the LDM process group. The data-product creation-time is used to update the "start" time in the current data-product selection-criteria.

  6. If nothing has been received in 60 seconds, then the process connects to the top-level ldmd on the upstream host and uses an IS_ALIVE message to inquire whether or not the relevant upstream LDM process is still running:

Downstream LDM 6.6 behavior in primary mode

Downstream LDM 6.6 behavior in alternate mode