Startup and Shutdown of QM

Startup and Shutdown of QM

Top  Previous  Next

 

QM maintains some persistent data in shared memory that is accessed by all QM users. This includes the locking tables, user tables, configuration data and other information that must be visible to all QM user processes.

 

 

Windows Systems

 

On a Windows system except when using a USB installation of QM, the shared memory is created by the QMSvc service. This service must be running for QM to be usable.

 

USB installations of QM use the QMUsbSrvr program in place of QMSvc for network access. QMConsole sessions on these systems do not require that this program is running.

 

QMSvc can be started and stopped from the QM Network Control program group item. In addition, QMSvc can be started, stopped or restarted from the Windows Control Panel Services screen or by use of the commands shown below from a Command Prompt window when logged in to Windows with administrator rights.

qmsvc -start

qmsvc -stop

qmsvc -restart

 

This assumes that the bin subdirectory of the QMSYS account is in the program search path. If not, the full pathname of the qmsvc executable must be used. These three commands normally pause briefly to allow time for the status message to be read. This pause can be eliminated, perhaps for use in a script, by an additional command line option:

qmsvc -start -nowait

 

Shutting down the QMSvc service will automatically logout all QM users.

 

 

Other Platforms

 

On other platforms, the QM shared memory must be explicitly loaded before users can enter QM. It may be manually discarded if required.

 

On some platforms, the installation process will add system startup and shutdown scripts to start QM when the system is booted and to take it down gracefully when the system is shutdown.  On other platforms, it may be necessary to do this manually, if desired. QM may be started, stopped or restarted at any time by typing the commands shown below from the operating system shell.

  qm -start

  qm -stop

  qm -restart

 

If you are not logged in as root, you may need to prefix these commands with sudo.

 

 

Executing a Startup Script

 

Sometimes it is useful to execute a paragraph or other command script when QM starts. This can be achieved using the STARTUP configuration parameter to specify the command to be executed. Multiple STARTUP parameters may be present, each command running as a separate QM process..

 

On Windows, the command is run when QMSvc starts. On other platforms, the command is run when the qm -start command is used.

 

The STARTUP parameter has two formats:

STARTUP=command

This command will be run as the SYSTEM (Windows) or root (Linux) user in the QMSYS account and would typically be the name of a VOC paragraph. The command may not include double quotes.

 

Because the SYSTEM and root users have privilege levels that may be higher than is appropriate for the tasks performed by processes initiated by the STARTUP configuration parameter, these processes can use the AUTHENTICATE command to authenticate user credentials and reduce the privilege level to that of some other user known to the operating system.

 

Alternatively, the parameter may include an account name, user name and password

STARTUP=command;account username password

This command will be run using the specified user name and account. Again, the command may not include double quotes. Because the configuration parameter file is readable by all users, it is useful to encrypt the password using the AUTHKEY command (described with AUTHENTICATE). In this case the encrypted password is prefixed by "ENCR:", for example

STARTUP=PHANTOM MAILSERVER;MAIL GSMITH ENCR:2CB51EFC17832221

A startup process will run the MASTER.LOGIN and LOGIN paragraphs in the same way as any other QM session. A QM process can recognise that it is a startup command by testing the value of the @TTY variable which will contain "startup". Phantoms started from the startup process will have this variable set to "phantom".