Chapter 5. The DMF Lock Manager
Prev |  | Next

## Chapter 5. The DMF Lock Manager

The `dmlockmgr(8)` process must be executing at all times for any DMF process to safely access and update a DMF database. The `dmlockmgr` process and its clients (such as `dmatmsp`, `dmatls`, `dmfdaemon(8)`, `dmvoladm(8)`, and `dmcatadm(8)`) communicate through various methods. These methods include files, semaphores, and message queues. There are times when abnormal process terminations will result in non-orderly exit processing that will leave files and/or interprocess communication (IPC) resources allocated. As a DMF administrator, periodically you will want to look for these resources to remove them.

| Note: HOME_DIR and SPOOL_DIR refer to the values of the `HOME_DIR` and `SPOOL_DIR` parameter, respectively, in the DMF configuration file. See Chapter 2, “Configuring DMF”.

The `dmlockmgr` files used by the database utilities are found in several different places. There are the following types of files:

- `dmlockmgr` communication and log files

- Individual transaction log files

## `dmlockmgr` Communication and Log Files

The `dmlockmgr` communication and log files are all found in a directory formed by `SPOOL_DIR/RDM_LM` . This directory contains the token files used to form the keys that are used to create and access the IPC resources necessary for the `dmlockmgr` to communicate with its clients, its standard output file, and the transaction file.

The token files in `SPOOL_DIR/RDM_LM` have the form shown in Table 5-1.

Table 5-1. `dmlockmgr` Token Files

File |  | Description
`dmlockmgr` | Used by the `dmlockmgr` and its clients to access `dmlockmgr`'s semaphore and input message queue
`dmatmsp`msp_or_ls_name | Used by the MSP/LS msp_or_ls_name and `dmlockmgr` to access the MSP's or LS's input message queue
`dmfdaemon`daemon | Used by the DMF daemon and `dmlockmgr` to access the daemon's input message queue
Process ID files: | Used by the process whose process ID is PID to access the process's input message queue
| `dmatread PID` |
| `dmatsnf PID`
| `dmcatadm PID`
| `dmdbrecover PID`
| `dmdbase PID`
| `dmvoladm PID`

The `dmlockmgr`, `dmatmsp`, `dmatls`, and `dmfdaemon` token files are limited in number, and they change infrequently. If a `dmlockmgr`, `dmatmsp`, or `dmfdaemon` terminates without removing the file, an existing token file will be used on restart. If a `dmatmsp`, `dmatls`, or `dmfdaemon` fails to remove the file and the MSP or LS name is changed, the file will remain until it is manually removed.

The files of the `PID` versions listed in Table 5-1 are removed from the `lockmgr` directory automatically when the command terminates or when the DMF daemon initializes. Do not create files of this name format in this directory because the daemon is likely to remove them.

The IPC resources used by DMF are always released during normal process exit cleanup. If one of the `dmlockmgr` client processes dies without removing its message queue, `dmlockmgr` will remove that queue when it detects the death of the client. It will not remove the token file.

| Note: Normally, the `dmlockmgr` process is terminated as part of normal shutdown procedures. However, if you wish to stop it manually, you must kill the process by using `kill(1)`. Killing the `dmlockmgr` process does not remove the `dmlockmgr` IPC resources or token file. If the `dmlockmgr` is restarted automatically by a DMF process, it will reuse the token file and IPC resources it left behind.

If the `dmlockmgr` process aborts, all DMF processes must be stopped and restarted in order to relogin to a new `dmlockmgr` process. If the `dmfdaemon` or `dmatmsp`/`dmatls` processes abort during a period when the `dmlockmgr` has died, when they restart they will attempt to restart the `dmlockmgr`. The new `dmlockmgr` process will detect existing DMF processes that were communicating with the now-dead copy of `dmlockmgr`, and it will send a termination message to those DMF processes.

The `dmlockmgr` maintains a log file that is named as follows, where yyyy, mm, and dd are the year, month, and day:

    SPOOL_DIR/RDM_LM/dmlocklog.yyyymmdd

The log file is closed and a new one opened at the first log request of a new day. These files are not typically large files, but a new file will be created each day and you should periodically remove older versions. You should maintain the `dmlockmgr` log files for as long as you maintain the database transaction journal files.

## `dmlockmgr` Individual Transaction Log Files

The individual transaction log files have the following form:

    dmatmspmsp_or_ls_name.log
    dmfdaemondaemon.log
    dmvoladmPID.log
    dmcatadmPID.log
    dmdbasePID.log
    dmdbrecoverPID.log
    dmselectPID.log

Most of the transaction log files will reside in the database directory (`HOME_DIR/daemon_name` for the `dmfdaemon`, `HOME_DIR/msp_name` for the `dmatmsp`, `HOME_DIR/ls_name` for the `dmatls`). In the case of the `dmfdaemon`, `dmatmsp`, and `dmatls`, each new transaction will reuse the same file generated by the last transaction, and there is no need to remove these files.

In the case of the PID transaction log files, the commands that generate them will generally remove them during their normal exit processing code. If there is an abnormal termination, these files will not be removed, and they may be quite large.

| Caution: Do not delete any orphaned transaction log files until you are sure the database is not actively in use. If a process aborts during a committed but incomplete transaction, the next process that contacts the `dmlockmgr` will use the information in the transaction log file to recover the incomplete transaction.

After you are sure the transaction log file will not be needed, it can be removed.

It is wise to periodically check for these files. Several DMF commands allow accessing of copies of database files in places other than the standard location, which may result in unnecessary transaction log files consuming disk space.

The transaction activity file, `SPOOL_DIR /RDM_LM/vista.taf`, is the transaction log file that contains information about active transactions in the system. It is used to facilitate automatic database transaction processing.

| Caution: Do not delete the `SPOOL_DIR/RDM_LM/vista.taf` file.

Prev | Table of Contents | Next
Chapter 4. The DMF Daemon |  | Chapter 6. Media-Specific Processes and Library Servers