KBEC-00117 - Unix CloudBees CD (CloudBees Flow) Agent Startup ModificationsSolution

Article ID:360033194111
1 minute readKnowledge base

Description

Under UNIX:

  1. All steps running on the agent require startup customization.

  2. CloudBees CD (CloudBees Flow) Agents may show an error at install or stop working after a change on the agent system or the agent’s user network profile.

The following are some common startup problems and solutions.

Setting a different environment on an CloudBees CD (CloudBees Flow) Agent and not changing the setup in the step

On the agent, create a wrapper for runAgent.sh

  1. Shut down the agent /etc/init.d/ecmdrAgent stop

  2. cd to CloudBees CD (CloudBees Flow) bin directory

  3. mv runAgent.sh .runAgent.sh

  4. Create your own script called runAgent.sh, which sets the environment and calls .runAgent.sh

  5. Start up the agent /etc/init.d/ecmdrAgent start

The CloudBees CD (CloudBees Flow) Agent sometimes will not start on Linux or Solaris

There are a couple of related problems. One is an error that says:

USER=foo is not a recognized command

Another is an error that says:

could not open libicuuc.so.34

Both problems are addressed by setting up the "su" line in the init.d script that starts the Agent - /etc/init.d/ecmdrAgent. The default line in this script is

su - $ACCOUNT -c "USER=$ACCOUNT ${AGENTEXE} --daemon"

The first problem can vary based on the user ($ACCOUNT) that is being set, because it depends on that user’s default shell. The solution is to use the correct syntax for this user’s shell. The most common fix is to change it to

su - $ACCOUNT -c "setenv USER $ACCOUNT;  ${AGENTEXE} --daemon"

The second problem is fixed by adding CloudBees CD (CloudBees Flow)'s directory to the LD_LIBRARY_PATH. This also must be tailored to the shell that is being run.

su - $ACCOUNT -c "USER=$ACCOUNT LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/commander/agent/bin ${AGENTEXE} --daemon"

or

su - $ACCOUNT -c "setenv USER $ACCOUNT;  setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:/opt/commander/agent/bin ${AGENTEXE} --daemon"

Warning

Changes to ecmdrAgent and runAgent.sh are not preserved during agent upgrade.