August 6, 2008 - Matthijs Haverink

Hint : VI Backup products don’t like bashrc customization !

Yesterday and today my colleague Rob Mokkink and I were getting very negative feelings towards the VizionCore vRanger Pro and Veeam Backup products, but like often, the problem existed behind the keyboard. But we prefer to call it an “undescribed feature” of these products.

We downloaded the latest versions of both products to see which product would fit best in our current environment and connecting to the Virtual Center servers went flawless but with neither of the 2 products we could connect to our ESX hosts. Errors that occured were errors that nobody experienced before, according to the product support forums.

VizionCore vRanger : hanging add host screen. Using the GUI or the client made no difference, as soon as we kicked off the add hosts command it hang, permanently.

Veeam Backup : “no value for $TERM and no -T specified”

Finally we found out that the problem was that we had used TPUT to customize the BASHRC so that when the user root logged on, the shell appeared in red. We used this feature to attend (so called) administrators on the fact that they now had GOD POWER and should know what they were doing:

#IF USER IS ROOT THE TERMINAL IS RED 
function setprompt 
{ 
  local RED="\[$(tput setaf 1)\]"
  local RESET="\[$(tput sgr0)\]"
  if [ `id -u` = 0 ] # check if user is root 
  then PS1="$RED[\u@\h:\W]$RESET "
  else
  PS1="[\u@\h:\W]$RESET "
fi
}
setprompt
EOF2
### END /ETC/BASHRC CONFIGURATION ###

And as you might now you, both products use SUDO to log on to the ESX hosts as root so they got the customized shell and that apparently caused the problem.

So the conclusion is that BASHRC customization is cool, but can cause “interesting problems”; so use with caution when using third party tooling !

Scripts backup / BASHRC / Matthijs Haverink / no value for $TERM and no -T specified / TPUT / Veeam Backup / Vizioncore / VMware / vRanger Pro /

Comments

  • Sven Huisman says:

    Hi Matthijs,

    Thanks for the tip. But can you explain a little bit more about BASHRC? What is it, when is it used?

    • Rob Mokkink says:

      Hi Sven,

      The /etc/bashrc contains system-wide definitions for shell functions and aliases for all users if it is referenced in their .bashrc of .bash_profile. On every linux or esx server i allways adjust this so that when a users logs in as root or use su to become root the prompt is red, meaning he or she can do some serious damage to the system.

      @Matthijs can you remove the EOF2 please 🙂

  • Hey Rob,

    Thanks for the explanation and I “removed” the EOF2 :).