Description of problem: Here is my config in /etc/openshift/routing-daemon.conf ACTIVEMQ_HOST=10.66.79.143,10.66.79.157 ACTIVEMQ_USER=routinginfo ACTIVEMQ_PASSWORD=routinginfopasswd ACTIVEMQ_PORT=61613 ACTIVEMQ_DESTINATION=/topic/routinginfo The related code in lib/openshift/routing/daemon.rb: @user = @cfg['ACTIVEMQ_USER'] || 'routinginfo' @password = @cfg['ACTIVEMQ_PASSWORD'] || 'routinginfopasswd' @port = (@cfg['ACTIVEMQ_PORT'] || 61613).to_i @hosts = (@cfg['ACTIVEMQ_HOST'] || 'activemq.example.com').split(',').map do |hp| hp.split(":").instance_eval do |h,p,ssl| { :host => h, # Originally, ACTIVEMQ_HOST allowed specifying only one host, with # the port specified separately in ACTIVEMQ_PORT. :port => p || @cfg['ACTIVEMQ_PORT'] || '61613', } end end Issue #1: in the above code, ssl parameter should be removed from the block. Issue #2: @cfg is nil in the instance_eval block, so when starting this service, will throw the following error: /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.20.2.1/lib/openshift/routing/daemon.rb:48:in `block (2 levels) in read_config': undefined method `[]' for nil:NilClass (NoMethodError) The workaround is replace :port => p || @cfg['ACTIVEMQ_PORT'] || '61613', to :port => p || @port, Issue #3: in /etc/init.d/openshift-routing-daemon, there is the following lines: # load any custom configuration elements for Watchman path = "/etc/sysconfig/watchman" if File.exists? path config = ParseConfig.new path config.get_params.each { |k| ENV[k] = config[k] } end Obviously these code is for watchman, so should remove them from openshift-routing-daemon Version-Release number of selected component (if applicable): rubygem-openshift-origin-routing-daemon-0.20.2.1-1.el6op.noarch How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
After added more debug info, found the workaround for issue #2 actually did not work either, because @port is also is nil in the instance_eval block, so here is updated workaround: Replace the follwoing code @user = @cfg['ACTIVEMQ_USER'] || 'routinginfo' @password = @cfg['ACTIVEMQ_PASSWORD'] || 'routinginfopasswd' @port = (@cfg['ACTIVEMQ_PORT'] || 61613).to_i @hosts = (@cfg['ACTIVEMQ_HOST'] || 'activemq.example.com').split(',').map do |hp| hp.split(":").instance_eval do |h,p| { :host => h, # Originally, ACTIVEMQ_HOST allowed specifying only one host, with # the port specified separately in ACTIVEMQ_PORT. :port => p || @cfg['ACTIVEMQ_PORT'] || '61613', } end end to @user = @cfg['ACTIVEMQ_USER'] || 'routinginfo' @password = @cfg['ACTIVEMQ_PASSWORD'] || 'routinginfopasswd' cfgcfg = @cfg @hosts = (@cfg['ACTIVEMQ_HOST'] || 'activemq.example.com').split(',').map do |hp| hp.split(":").instance_eval do |h,p| { :host => h, # Originally, ACTIVEMQ_HOST allowed specifying only one host, with # the port specified separately in ACTIVEMQ_PORT. :port => p || cfgcfg['ACTIVEMQ_PORT'] || '61613', } end end
The instance_eval is reseting the instance variable @cfg. I'll fix that issue. Good find!
Opened PR upstream. Will merge to enterprise-server after it makes it upstream. https://github.com/openshift/origin-server/pull/5976
Verified this bug with rubygem-openshift-origin-routing-daemon-0.20.2.3-1.el6op.noarch, and PASS. When the following config value is set in /etc/openshift/routing-daemon.conf ACTIVEMQ_HOST=10.66.79.157,10.66.79.143 ACTIVEMQ_USER=routinginfo ACTIVEMQ_PASSWORD=routinginfopasswd ACTIVEMQ_PORT=61613 ACTIVEMQ_DESTINATION=/topic/routinginfo restart routing-daemon service successfully. When the following config value is set in /etc/openshift/routing-daemon.conf ACTIVEMQ_HOST=10.66.79.157,10.66.79.143:61614 ACTIVEMQ_USER=routinginfo ACTIVEMQ_PASSWORD=routinginfopasswd ACTIVEMQ_PORT=61613 ACTIVEMQ_DESTINATION=/topic/routinginfo restart routing-daemon service successfully.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2014-1979.html