IBM Support

How to run multiple Rational Build Forge agents on UNIX and Linux

Question & Answer


Question

How do you run multiple instances of IBM Rational Build Forge agent on a UNIX or Linux host?

Cause

There are a few different reasons why you may need to run multiple agents on a single host, including, but not limited to:

  1. Need to run multiple versions of Build Forge agent
  2. Need to run with multiple magic_login users
  3. Need to run with multiple configuration options

Answer

This instruction is targeted on systems running UNIX and UNIX-like operating systems that are officially supported by Rational Build Forge including:

  • Solaris 8, 9, and 10
  • RedHat and SUSE Linux
  • AIX 5.3
  • HP-UX 11.11B

Note: These instructions should be transferable to any system running the inetd or xinetd super servers.

The first thing you need to consider is which of the above scenarios best matches the intended goal, as that will determine what additional steps need to be taken.

  • If all of the agents are the same version, but just need different configurations, then you need to install a single agent binary only.
  • If multiple agent versions are needed, then each agent needs a unique installation path. You can do this by installing each version of Build Forge agent into their own directories, for example
    /usr/local/bfagent7026/bfagent
    and
    /usr/local/bfagent7121/bfagent,
    or
    by renaming the resulting binaries to unique names, like
    /usr/local/bin/bfagent7026
    and
    /usr/local/bin/bfagent7121.
  • In the above listed examples, numbers 2 and 3 are going to be very similar, just that number 2 requires that the agent not run as the 'root' user.


For all examples, you need to install the agent configuration files into /usr/local/etc.

To accomplish this, you need to:

  1. Modify the /etc/services file
  2. Configure inetd
  3. Configure xinetd
  4. Restart inetd or xinetd



    Modify /etc/services

    For each agent that will need to be run, there needs to be a corresponding entry in /etc/services, listing which ports these agents will be listening on. Each entry needs to have a unique name for the entry:

    bfagent1  5551/tcp  # IBM Rational Build Forge Agent using /usr/local/etc/bfagent1.conf

    bfagent2  5552/tcp  # IBM Rational Build Forge Agent using /usr/local/etc/bfagent2.conf

    ...

    bfagentN  555N/tcp  # IBM Rational Build Forge Agent using /usr/local/etc/bfagentN.conf

    There can be as many entries as needed to accomplish the required configuration.



    Configure for inetd

    For Operating Systems (Solaris 8 & 9, AIX, HP/UX) that use inetd, add some entries to /etc/inetd.conf (follow this for Solaris 10 as well, but there will be further instructions later on how to import this config to the svcmgr).

    Note: If magic_login is being used for any of these agents, the 'root' portion needs to be changed to a non-root user that will still have read/write access to the filesystem.

    bfagent1 stream tcp nowait root /usr/local/bin/bfagent bfagent -f \ /usr/local/etc/bfagent1.conf

    bfagent2 stream tcp nowait root /usr/local/bin/bfagent bfagent -f \ /usr/local/etc/bfagent2.conf

    ...

    bfagentN stream tcp nowait root /usr/local/bin/bfagent bfagent -f \ /usr/local/etc/bfagentN.conf

    Note: Each example above should be on a single line.

    For Solaris 10 hosts, this file needs to be imported into the service manager with inetconv:

    /usr/sbin/inetconv -i /etc/inetd.conf

    If there are already configured agents that need to be modified, then the entries will need to be edited using the svccfg utility. For example, to change an existing bfagent to run as the user 'build' instead of the default 'root':

    /usr/sbin/svccfg -s bfagent1/tcp setprop inetd_start/user=build

    To see a full list of properties that can be modified via this method, use the svccfg 'listprop' sub-command:

    svccfg -s bfagent/tcp listprop

    And in order for this change to be made effective, the configuration needs to be reloaded:

    /usr/sbin/svcadm refresh svc:/network/bfagent1/tcp



    Configure for xinetd

    For hosts running xinetd (primarily Linux), edit/create /etc/xinetd.d/bfagent:


    service bfagent1
    {
            socket_type             = stream
            wait                    = no
            user                    = root
            server                  = /usr/local/bin/bfagent
            server_args             = -f /etc/bfagent1.conf
            flags                   =
            log_on_success  += HOST DURATION
            log_on_failure  += HOST
            passenv                 =
            disable                 = no
    }

    service bfagent2
    {
            socket_type             = stream
            wait                    = no
            user                    = root
            server                  = /usr/local/bin/bfagent
            server_args             = -f /etc/bfagent2.conf
            flags                   =
            log_on_success  += HOST DURATION
            log_on_failure  += HOST
            passenv                 =
            disable                 = no
    }

    ...

    service bfagentN
    {
            socket_type             = stream
            wait                    = no
            user                    = root
            server                  = /usr/local/bin/bfagent
            server_args             = -f /etc/bfagentN.conf
            flags                   =
            log_on_success  += HOST DURATION
            log_on_failure  += HOST
            passenv                 =
            disable                 = no
    }



    Restart inetd or xinetd

    For both inetd and xinetd systems, the associated superserver will need to be restarted.

    For Solaris 8 & 9, AIX, and HP/UX hosts:

    kill -HUP `ps -fea | awk '/[i]netd/ {print $2}'`

    For Linux hosts:

    service xinetd restart

    You can check to see that services are listening on the appropriate ports with the netstat command:

    netstat -an | grep 555

    And look for the ports that were configured above.

[{"Product":{"code":"SSB2MV","label":"Rational Build Forge"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Agent: Installation","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"7.0.2;7.0.2.1;7.0.2.2;7.0.2.3;7.0.2.4;7.0.2.5;7.0.2.6;7.1;7.1.1;7.1.1.1;7.1.1.2;7.1.1.3;7.1.1.4;7.1.2;7.1.2.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
20 April 2020

UID

swg21473102