showipc is a tool that the DBA can use in order to look at the Linux kernel ipc configuration, and to look at the Adabas/NET-WORK ipc structures and clean them up. For each database, showipc displays the shared memory, the message queues, and the semaphores associated with the database in question.
The following options are available:
showipc [-adfhiksv] [-e<string>] [-g<g_name>] [-r<sec>] [-u<u_name>] [<dbid>...]
One or more <dbid> arguments may be supplied. If <dbid> is omitted, showipc processes the ipc structures for all active databases. In addition to the numeric values that represent valid DBIDs, the strings CSCI, ACS and U can also be supplied. CSCI (client server communication interface) returns information for all ipc elements of CSCI users. ACS returns information about the ipc elements used by NETACS (NET-WORK access server). U indicates all elements that cannot be associated with a database (database unknown).
showipc also supports multiple logical NET-WORK nodes. The NET-WORK ipc structures are identified by the <dbid> zero and a NET-WORK ID. Unless the -a or -e options are used (see below), information is only displayed for the default NET-WORK ID. If the environment variable NET_WORK_ID is set, the corresponding NET-WORK ID will also be processed.
Note
The information provided above concerning NET-WORK is only relevant for NET-WORK
Version 2, which is no longer supported with Adabas Version 6. However, showipc of Adabas
Version 6 also supports Adabas Version 5 databases, which can still be used with NET-WORK
Version 2.
The following table shows the meanings of the various options that are supported:
| Option | Meaning |
|---|---|
| -a | displays the structures of all of the logical NET-WORK nodes that are running simultaneously. |
| -d | this option was used up to Adabas Version 3.1. For compatibility reasons, this option can still be specified with the current version of Adabas, but it has no effect. |
| -e<string> | specifies additional NET-WORK IDs for which information is to be displayed. Because the first character of a NET-WORK ID must be unique, each character of <string> uniquely identifies one NET-WORK ID. |
| -f | used with the -k option, this forces the removal of the NETACS and CSCI elements (which would not be deleted otherwise). |
| -g<g_name> | searches for the ipc elements that are owned by the group <g_name>, instead of the default users ('sag', 'adabas', 'natural', 'esq', $SIPGROUP). |
| -h | calls up a help screen that explains how to use showipc. |
| -i | used with the -k option, this requests confirmation before deleting any ipc element. |
| -k | removes ipc elements that are no longer in use. Before it removes anything, showipc checks to see whether the GCB shared memory of the database is still in use. If it is still in use, any removal requests are rejected. Software AG strongly recommends that the -i option is used with the -k option. showipc is run with the effective user ID of root, otherwise you would not be able to remove the IPC resources if they were created by an Adabas nucleus process that was started by another user. |
| -r<sec> | the specified command is repeated every <sec> seconds. The repetition can be stopped by entering CRTL-C. |
| -s | displays the ipc configuration values of the running Linux kernel. This can be useful to check whether the Linux kernel is configured correctly. |
| -u<u_name> | searches for the ipc elements that are owned by the user <u_name>, instead of the default users ('sag', 'adabas', 'natural', 'esq', $SIPUSER). |
| -v | displays the database information in verbose format. |
The first column of the default output format contains either "NET" for NET-WORK (followed by the NET-WORK ID if it is not the default NET-WORK ID), or "NACS" for NETACS, or "CSCI" for CSCI, or the numeric DBID of the database in question. This is followed by a list of the ipc elements for the database. The entry for each element consists of an abbreviation to indicate its type, and, separated by a colon, the ipc id of the element. This id can then be used for the "ipcrm" command ("showipc -k <dbid>" is, however, much more convenient). The following abbreviations are used:
| ATB | attached buffer shared memory |
| CSA | common shared area |
| CSM | CSCI shared memory |
| DRV | Adabas ipc driver shared memory |
| GCB | general control block |
| GDT | global database table (NET-WORK) |
| OPR | shared memory created with ADAOPR (called with CSA=) |
| PHx | protocol handler with ID x (NET-WORK) |
| ESi | Adabas SQL server shared memory ID i |
| CLM | communication client message queue |
| CSQ | CSCI message queue |
| RSQ | user response queue |
| SRV | communication server message queue |
| SVQ | nucleus thread queue |
| USQ | user request queue |
| CLS | communication client semaphore |
| CSS | CSCI semaphore |
| PSE | private semaphore |
| SEM | other semaphore |
| ESQ | Adabas SQL server semaphore |
The verbose output format (-v option) displays additional information for each element. Three tables are displayed for each database: one for shared memory, one for message queues, and one for semaphores. The columns in these tables have the following meanings:
| Column | Meaning |
|---|---|
| TYPE | type of ipc element (see abbreviations) |
| NI | NET-WORK ID (if not default); may be truncated to one character |
| ID | ipc ID |
| SIZE | size of the shared memory in bytes |
| Column | Meaning |
|---|---|
| LOPPID | process ID of the process that performed the last shmop() call |
| CRPID | process ID of the creator process |
| ATTPROC | number of attached processes (not always supported by the operating system) |
| Column | Meaning |
|---|---|
| TYPE | type of ipc element (see abbreviations) |
| NI | NET-WORK ID (if not default); may be truncated to one character |
| ID | ipc ID |
| NBYTES | number of bytes in the message queue |
| NMSGS | number of messages in the message queue |
| LSND | process ID of the last sending process |
| LRCV | process ID of the last receiving process |
| Column | Meaning |
|---|---|
| TYPE | type of ipc element (see abbreviations) |
| NI | NET-WORK ID (if not default); may be truncated to one character |
| ID | ipc ID |
For NETACS elements, the column TYPE is replaced by DOMN, which represents the NETACS domain.
If the running kernel does not have the default name, showipc will abort with an appropriate error message. This can be prevented by setting the environment variable SIP_KERNAM to the correct name, in csh for example "setenv SIP_KERNAM '/mykernel'".
The following environment variables are used together with showipc:
| Environment Variable | Meaning |
|---|---|
| NET_WORK_ID | This specifies a NET-WORK ID to be processed in addition to the default NET-WORK ID (see the showipc options -e and -a for further information). |
| SIP_KERNAM | This sets the name of the kernel (see the note above for further information). |
| SIPGROUP | If the environment variable SIPGROUP is set, its contents will be appended to the list of default groups (see also option -g). |
| SIPUSER | If the environment variable SIPUSER is set, its contents will be appended to the list of default users (see also option -u). For example, if SIPUSER is set to "harry", all of the ipc elements that belong either to the default users (currently "sag", "adabas", "esq" and "natural") or belong to "harry" will be displayed. |
The following messages may be received when using showipc:
| Cleared up driver resources for DB xx | |
| Explanation |
showipc not only removes ipc structures if the -k option is used, but for Adabas Version 2.1 and above also releases the ipc driver resources for the corresponding database. |
| Action |
None. |
| Could not attach to global data area of database xxx | |
| Explanation |
The CSA of the database xxx is corrupted or not in the format expected by showipc. |
| Action |
If this problem occurs with an active database, contact your nearest Adabas support centre. |
| Database yy of Adabas Vz.z might be incorrectly displayed by showipc V x.x | |
| Explanation |
The database in question is of a more recent version than the current version of showipc, which means that it cannot be guaranteed that the output of the ipc structures for this database is correct. |
| Action |
Use an appropriate, more recent version of showipc. |
| Db xx is of version ww - please use version ww of showipc to remove | |
| Explanation |
The nucleus of database xx is of a higher version than the showipc called. showipc will not remove any ipc structure for this database. |
| Action |
Use an appropriate, more recent version of showipc. |
| Found inconsistent data structures for DB xxx | |
| Explanation |
The internal data structures of database xxx are incompatible with showipc. |
| Action |
Check the version of the database. If it is more recent than the version of showipc that you are using, use an appropriate version of showipc. If the problem still occurs, contact your nearest Adabas support centre. |
| GCB of DB xx still in use, I do not remove anything | |
| Explanation |
showipc -k was called for a database that is still active (running nucleus or being accessed by Adabas utilities). No ipc structures will be removed. |
| Action |
If you really want to remove the ipc structures for the database in question, terminate the process that is accessing the database (use showipc -v <xx> to determine the process) and try the command again. |
| GDT is still in use by DB xx; not removed | |
| Explanation |
There is still at least one database using the GDT: it will not be removed by showipc. |
| Action |
None. |
| I do not remove private semaphores | |
| Explanation |
showipc does not remove Adabas semaphores that are not associated with a specific database. |
| Action |
None. Removing the semaphores with ipcrm could cause Adabas utilities to fail/abort. |
| NET-WORK xx still running, I do not remove anything | |
| Explanation |
The NET-WORK with the specified ID is still active. showipc does not remove any ipc structures that are associated with this NET-WORK ID. |
| Action |
None. |
| Sorry, but this program has to be run with supervisor privileges | |
| Explanation |
The showipc executable does not have the correct permissions set. It must have a set user ID permission, and have the owner root. |
| Action |
Check and, if necessary, correct the permissions. |
| Sorry, I will remove CSCI elements only with -f option | |
| Explanation |
CSCI elements can only be removed if the -f option is used. |
| Action |
Add the -f option to the -k option. |
| Sorry, I will remove CSCI elements only with -f option | |
| Explanation |
NET-ACS elements can only be removed if the -f option is used. |
| Action |
Add the -f option to the -k option. |
| Structure mismatch for DB xx - Cannot identify version | |
| Explanation |
The internal data structures of the database in question cannot be correctly interpreted. |
| Action |
This message may occur during the startup of a database: in this case it can be ignored. |
| Warning: could not find adanod for clean up of Adabas driver | |
| Explanation |
In some cases, the utility adanod is required when cleaning up the Adabas ipc driver resources. |
| Action |
Set the environment variable ADANOD to the full path name of the adanod executable. |
| Warning: Found <structure> with invalid database ID xx contained | |
| Explanation |
A structure that belongs to one of the relevant users has an invalid key. The structure can be either shared memory, a message queue, or a semaphore. |
| Action |
Check which process created the structure in question (showipc displays the creator's process ID). If it is not a Software GmbH product, it should be modified so that it does not interfere with Adabas. If it is a Software GmbH product, contact your nearest Adabas support centre. |
| Warning: Some NET-WORK IDs may be displayed truncated to one character | |
| Explanation |
When the showipc options -e or -a are used, showipc might truncate some NET-WORK IDs to one character. NET-WORK IDs are, however, identified uniquely by their first character. |
| Action |
You can force one NET-WORK ID to be expanded by setting the environment variable NET_WORK_ID accordingly. |
showipc
This displays the ipc structures of all Adabas databases and of the default NET-WORK ID.
showipc -av
This displays the ipc structures of all Adabas databases and of all logical NET-WORK IDs in the verbose format.
showipc -ki 127
This removes all of the ipc structures of database 127 if the database nucleus is not running. showipc will ask for confirmation before an ipc structure is removed.