How to Start GlassFish Message Queue 4.x Broker Automatically on Solaris/Linux as a non-root User ? (Doc ID 1219184.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 2.1 and later
Information in this document applies to any platform.

Goal

In Unix, the imqbrokerd.conf file in /etc/imq for Solaris and /etc/opt/sun for Linux is configured to start/stop the GlassFish Message Queue (MQ) broker as part of normal UNIX system operation by setting AUTOSTART=YES as shown below.


#############################################################################
#
# Message Queue Broker Configuration file
#
# #####hpux-dev#####
# This file controls behavior of the /etc/init.d/imq ( /sbin/init.d/imq for
# HP-UX) script when it is executed with the ``start'' argument.
#
# the supported properties are:
# AUTOSTART=[YES|NO]
# - YES indicates the broker will be
# started from init.d
# ARGS=[optional args]
# - the arguments (if any) to pass to the
# broker at startup
# RESTART=[YES|NO]
# - YES indicates that imqbrokerd should be restarted if it
# exits for any abnormal reason.
#
# Example:
# setting the properties to:
# AUTOSTART=YES
# ARGS=-name newbroker -port 8888
#
# will start a broker w/ an instancename of
# newbroker and portmapper name of 8888
#
AUTOSTART=YES
ARGS=-name HABroker
RESTART=YES


However, the MQ broker always start as root even though the ownership of the broker instance directory has been changed to the unix user, "mquser".

The following steps provides a solution for this problem.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms