Linux

Intended audience: administrators, developers

Debian + Ubuntu

Binary packages are available for Debian based systems in the official repositories. Use apt-get to install them e.g. to install the Tango database and test device server:

$> sudo apt install mariadb-server\
   sudo apt install tango-db tango-test

The above packages install the Tango core C++ libraries, database and TangoTest server.

Non-interactive installation

If you want to install in non-interactive way, here are the steps you need to follow:

  • installation of non-interactive installation tools (with administration rights):
$> sudo apt install --assume-yes debconf
  • setting root password for MariaDB package installation
$> echo "mariadb-server mysql-server/root_password password ${DB_ROOT_PASSWORD}" | sudo debconf-set-selections\
   echo "mariadb-server mysql-server/root_password_again password ${DB_ROOT_PASSWORD}" | sudo debconf-set-selections

where ${DB_ROOT_PASSWORD} is your MariaDB database root password you want to set.

  • mariadb package installation:
$> sudo apt install --assume-yes mariadb-client mariadb-server
  • answering to the mysql_secure_installation questions:
$> sudo apt install --assume-yes expect\
   SECURE_MYSQL=$(sudo expect -c "
      set timeout 10
      spawn mysql_secure_installation
      expect \"Enter current password for root (enter for none):\"
      send \"${DB_ROOT_PASSWORD}\r\"
      expect \"Change the root password?\"
      send \"n\r\"
      expect \"Remove anonymous users?\"
      send \"y\r\"
      expect \"Disallow root login remotely?\"
      send \"y\r\"
      expect \"Remove test database and access to it?\"
      send \"y\r\"
      expect \"Reload privilege tables now?\"
      send \"y\r\"
      expect eof
      ")\
  echo "${SECURE_MYSQL}"
  • setting parameters for tango-db package installation:
$> echo "tango-common tango-common/tango-host string ${TANGOSERVER}:${TANGOPORT}" | sudo debconf-set-selections\
   echo 'tango-db tango-db/dbconfig-install boolean true' | sudo debconf-set-selections\
   echo "tango-db tango-db/mysql/admin-pass string ${DB_ROOT_PASSWORD}"  | sudo debconf-set-selections\
   echo "tango-db tango-db/mysql/app-pass password ${DB_TANGO_PASSWORD}" | sudo debconf-set-selections

where ${TANGOSERVER} is the Tango Host name, ${TANGOPORT} is the Tango Host port on which will be waited the Tango connections, ${DB_ROOT_PASSWORD} is your MariaDB database root password you set during MariaDB installation and ${DB_TANGO_PASSWORD} is your MariaDB tango database you want to set and which will be used by Tango tools.

  • tango-db package installation:
$> sudo apt install --assume-yes tango-db
  • tango-test package installation
$> sudo apt install --assume-yes tango-test

Other packages

You will also need the Java based tools like jive, astor etc. These are available with the source code installation.

Another option is to install the latest binary Java debian package for Tango 9.2.5 (assuming you have installed Tango 9.2.5) from https://people.debian.org/~picca/libtango-java_9.2.5a-1_all.deb

To install this binary package do the following:

$> sudo apt install --assume-yes wget\
   wget -c https://people.debian.org/~picca/libtango-java_9.2.5a-1_all.deb\
   sudo dpkg -i ./libtango-java_9.2.5a-1_all.deb

You will then have the Tango Java tools installed in /usr/bin e.g. /usr/bin/jive

You might also want PyTango. Python binaries can be installed from the official repositories, either

$> apt install python3-pytango

or if you need specifically Python2

$> apt-get python-pytango

CentOS

RPM packages are available for RedHat based systems in the MAX-IV’s repository. Use yum to install them e.g. to install the TANGO database and test device server:

$> sudo yum install mariadb mariadb-server
   sudo yum install libtango9 tango-db tango-test

The above packages install the Tango core C++ libraries, database and TangoTest server.

Installation

If you want to install TANGO on CentOS, here are the steps you should follow:

  • add and enable MAX-IV’s repository:
$> sudo yum-config-manager --add-repo http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/
   sudo yum-config-manager --enable http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/
   sudo yum makecache
  • install MariaDB:
$> sudo yum install mariadb-server mariadb
  • run mysql_secure_installation script:
$> sudo mysql_secure_installation
  • install TANGO library:
$> sudo yum install libtango9 libtango9-devel
  • install tango-db and tango-common packages:
$> sudo yum install tango-db tango-common
  • create TANGO database:
$> cd /usr/share/tango-db/
   sudo ./create_db.sh
  • set up TANGO environment:
$> sudo nano /etc/tangorc

For example:

TANGO_HOST=tangobox:10000
  • set up environment variables:
$> sudo nano /etc/profile.d/tango.sh

For example:

. /etc/tangorc
export TANGO_HOST
  • start and enable TANGO database:
$> sudo systemctl start tango-db
   sudo systemctl enable tango-db
  • install Starter and TangoTest:
$> sudo yum install tango-starter tango-test
  • start and enable Starter:
$> sudo systemctl start tango-starter
   sudo systemctl enable tango-starter
  • install Java based tools:
$> sudo yum install tango-java
  • install PyTango:
$> sudo yum install python-pytango

Video

The following video (by Mohamed Cherif Areour, in French with English subtitles) shows you how to install Tango on Ubuntu and LinuxMint.



Testing

How to test that everything was correctly installed

You have to have “tango-test” been installed and check where is it located (you can use “locate TangoTest” command) and start it with “test” instance.

For example:

$> /usr/lib/tango/TangoTest test

Console should display “Ready to accept request”.

After you may go to Jive and choose the following window (see the image below):

../_images/jive.png

TangoTest (it is a server)-> test (it is an instance) -> TangoTest (it is a class) -> sys/tg-test/1 (it is a device)

Right click on the device and choose “Test device”.

You should get a new window with “Attributes” where you should see the values. That means you have done everything correct.