Using a command service object

This example shows how to define a command service object to start a program that writes entries to the operating system's system log when a queue manager is started or stopped.

  1. The command service object is defined, using the DEFINE SERVICE MQSC command:
    
    DEFINE SERVICE(S2) +
    CONTROL(QMGR) +
    SERVTYPE(COMMAND) +
    STARTCMD('/usr/bin/logger') +
    STARTARG('Queue manager +QMNAME+ starting') +
    STOPCMD('/usr/bin/logger') +
    STOPARG('Queue manager +QMNAME+ stopping')
    
    Where:
    • logger is the AIX® or Linux® system supplied command to write to the system log.
    • +QMNAME+ is a token representing the name of the queue manager.