inittab error - respawning too fast: disabled for 5 minutes

The Error

An error similar to the following is being logged to /var/spool/messages

Oct 12 13:23:15 node1 init: Id "wsmq" respawning too fast: disabled for 5 minutes

Possible reason for this error

This error is caused by an entry in /etc/inittab similar to the example below.

wsmq:2345:respawn:su - mqm -c "/opt/mqm/bin/strmqm DispensingQueueManager" >> /tmp/wsmq.initlog 2>&1

This inittab entry is using the respawn command to restart the the websphere MQ process should it stop running for any reason.

However this process is not a good candidate for restarting from inittab because the executable /opt/mqm/bin/strmqm spawns a child process, probably using the system call "exec" to replace itself with another program similar to the following.

amqzxma0 -m DispensingQueueManager

This additional program then forks to create additional copies of itself as required, however the key point here is the MQ start executable (strmqm) ceases to exist very soon after it is created. Therefore because of the respawn option in inittab, init will attempt to restart strmqm. strmqm will attempt to start, find that MQ is already running and exit, init will attempt to restart it and so on. This process generates the error shown above.

To fix change the "respawn" option to "once" and look for an alternative way to restart the process if required.