[UNIX, Linux, Windows, IBM i]

crtmqdir (create IBM MQ directories)

Create, check, and correct IBM® MQ directories and files.

Purpose

Use the crtmqdir command to check that the necessary directories and files used by IBM MQ exist and have the appropriate ownership and permissions. The command can optionally create any missing directories or files, and correct any inconsistent ownership or permissions.
Attention: The scope of this command is MQ_DATA_PATH which, for example, is /var/mqm on Linux®. This command does not affect MQ_INSTALLATION_PATH, which is /opt/mqm on Linux.

The system-wide directories and files are created as part of the IBM MQ installation procedure. The tool can subsequently be run to check or ensure that the necessary IBM MQ directories and files continue to have appropriate ownership and permissions.

Important:
  1. You must have sufficient permission to determine whether the configuration is correct and, optionally, correct that configuration.
  2. When you use the -a parameter, no queue managers can be running.
  3. When you use the -m parameter, the queue manager you specified must be stopped.
  4. You must not create, delete, or start any queue managers while crtmqdir is running.

[AIX][Linux]On AIX® and Linux, this typically means that you are the mqm user. This is necessary when using the -a or -m parameters, together with the -f parameter.

Depending on the configuration, the crtmqdir command might require you to be an operating system administrator, or superuser.

[AIX][Linux]Note: The security of data path/log/qm, on AIX and Linux, is set to 2770.

[Windows]On Windows, this typically means that you are a member of the IBM MQ administration group. This is necessary when using the -a or -m parameters.

[IBM i]On IBM i, you must run the command as a member of the IBM MQ administrative group. This is necessary when using the -a or -m parameters, together with the -f parameter.

Syntax

Read syntax diagramSkip visual syntax diagram crtmqdir -a-mQMgrName-s-f-xstandardhigh

Required parameters

Specify one of the following parameters only:
-a
Check all directories; that is, system-wide directories and all the queue managers.
Attention: The queue manager must be associated with the current installation.
-m
Check directories for the specified queue manager name.
Attention: The queue manager must be associated with the current installation.
-s
Check the system-wide directories; that is, directories that are not queue manager specific.

Optional parameters

-f
This option causes directories or files to be created if they are missing, and on AIX and Linux only, ownership or permissions to be corrected if they are inappropriately set.

If -a or -m is specified on AIX and Linux, as a minimum, the program attempts to correct ownership or permissions on files that were created at the time of queue manager creation.

-x level of permissions
Specify one of the following values only:
standard
By default, directories and files get a standard set of permissions, but a high level of permissions can be requested.
high
This option applies to the following platforms:
  • [AIX]AIX
  • [Linux]Linux
It ensures that files in the following directories can be deleted only by the owner:
  • errors
  • trace
  • webui

Return codes

Table 1. Return code identifiers and descriptions
Return code Description
0 Successful completion
10 A warning occurred
20 An error occurred

Examples

  • The following command checks and fixes the system-wide directories:
    crtmqdir -s -f
  • The following command checks (but does not fix) queue manager QM1:
    crtmqdir -m Qm1