Personal tools
You are here: Home HowTos How to install Tango on host running the Ubuntu Operating System

How to install Tango on host running the Ubuntu Operating System

This HowTo gives all the details allowing the reader to install Tango on his Ubuntu computer using Tango binary packages

Tango core is now available as binary packages for the Ubuntu distribution of the GNU/Linux Operating System releases 10.04 (lucid), 10.10 (maverick) and 11.04 (natty). It has been split into several binary packages available on the free software launchpad web site. The tango binary core packages are stored in a Personal Packages Archive (PPA) named core attached to the launchpad team tango-controls. The launchpad web site has a page related to this PPA. Each PPA defines one Ubuntu repository that you can use to download binary packages. In this repository, there are packages for the i386 and amd64

architectures.

The Ubuntu operating system uses the debian packaging system. Ubuntu provides the Synaptic tool which provides a graphical user interface to the binary packages system. To start Synaptic, on the main menu, click on "System/Administration" and choose "Synaptic Package Manager" or simply type "sudo synaptic" in a shell window.

Prerequisites

YOU MUST DO THIS BEFORE INSTALLING TANGO !

Disable IPv6

Tango has not been yet fully tested with IPv6 and some features do not work with IPv6 network addresses. Therefore, we recommend to disable IPv6 on your host. To check if IPv6 is enable or disable, on a shell window, type the following command

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

If the command result is 0, this means that IPv6 is enable. One means that IPv6 is disable.

To disable IPv6, add the following lines in your /etc/sysctl.conf file

and reboot your host.

#disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Check WIFI connection (if you use one)

If you are using a laptop and a Wifi connection, by default, the Ubuntu Network Manager start the wifi only after a login has been performed by the computer. You have to change this behavior so that TANGO can be started automatically at boot time. Right click on the Network Manager icon in the Ubuntu notification area and select 'Edit Connections'. Choose the Wireless tab, select your connection and click 'Edit'. On the Wireless tab, make sure that the 'Available to all users' toggle is ON.

Wifi config

Ubuntu 11.04 and its /etc/hosts file

Since its release 11.04, the /etc/hosts file does not contain by default the host IP address. It only contains loopback addresses. This set-up is not actually supported by all Tango features. To get all Tango's features, you need to add the host IP address in the /etc/hosts file and to comment out the entry defining the host name on a loopback address . Here is an example of the a modified /etc/hosts file

a.b.c.d      myhost  # The added line
127.0.0.1    localhost.localdomain    localhost
::1          myhost localhost6.localdomain6    localhost6
#127.0.1.1   myhost  # The commented out line

# The following lines are desirable for IPv6 capable hosts

If you are using a dynamic IP address (using DHCP), it's not possible to store this dynamic address in the /etc/hosts file! In such a case and until Tango supports this kind of set-up, you will not be able to use the Tango Access Control (TAC) sub-system and you will also not be able to receive Tango events in a Java application.

Adding the TANGO core PPA repository

To download packages, your host has to know the internet addresses where these packages  are available.

With a direct internet connection

If your host has a direct connection to the internet, adding a Launchpad PPA to your repository list is very easy. Start the Synaptic tool, click on Settings / Repositories and select the "Third-Party Software" tab. Click on the "Add" button and type ppa:tango-controls/core in the APT line field then click the "Add Source" button.

Setting repository

 

To force an update of the available packages list, click on the "Reload" icon on the Synaptic main icon bar.

Behind a proxy

Adding a repository to your repository list also means that you have to get the public key associated to the PPA. This key is used to verify the package sender. When your are behind a proxy, the Synaptic tool is not able to download the PPA public key even if a proxy is defined at the host level and in the Synaptic Network settings. You have to do this manually. Don't worry, this is not a complicated task. Simply type the following commands in a shell window

sudo bash
export http_proxy=http://<my_proxy>:<port>
export https_proxy=http://<my_proxy>:<port>
add-apt-repository ppa:tango-controls/core
apt-get update

Installing Tango core packages

Examples will be given for several cases:

  1. Installing Tango on a control system front-end computer
  2. Installing Tango on a control system main server
  3. Installing a stand-alone Tango development host
  4. Installing a Tango python development host in a distributed Tango system

These are not the only cases that one can find but they cover the most common ones. If your case is not exactly one of these, reading  this document should help you to understand the concepts and to find out what you have to install to fulfill your needs.

Installing Tango on a control system front end computer

Without TANGO events

For such a host, installing Tango means installing the tango, log4tango and omniorb libraries plus the starter device server. To do so, start Synaptic and type tango in its "Quick search" box. Simply select the tango-starter package, mark it  for installation (right click) and apply the selection (apply icon on synaptic main icon bar). With the debian packages dependency system, this will install all the necessary packages (libtango7, lib4tango4, libomniorb4-1....). If you are a Tango python user, simply add the python-pytango package in your selection before applying the selection.

You will be able to enter your TANGO_HOST in the following window when it will pop-up.

Setting tango host

Replace the default "localhost:10000" with the host name where the Tango database server process is running and the port number on which it has been started then click on "Forward". Once the packages are installed, one entry is added into the Tango database for the Starter device server process and the process is started. Nevertheless, the path used by the Starter device server to find other device server process executable is not initialized. You have to do it according to how you configure your system using the Starter device property or even better using the Astor GUI.

The Tango starter device server process will automatically start each time the host is booted.

Using the TANGO event system

On top of the tango-starter package, if you are using the Tango event system, you also need to install the notifd binary. Type omninotify in the Synaptic "Quick search" box, select the omninotify package, mark it for installation (right click) and apply the selection (apply icon on the synaptic main icon bar). Don't forget to correctly configure your host if you want the starter to also manage the notifd process (/usr/lib/tango in the device server path and click the toggle "Use Events" in the astor/host "Edit Properties" window)

Installing Tango on a control system main server

Without TANGO event

In this case, on top of the classic libraries (Tango, log4tango, omniorb), you need to install

  • The MySQL RDBMS
  • The Tango database server
  • The Tango starter tool
  • The Tango java tools (Jive, Astor, atkpanel,...)

We need to install the MySQL server. Type mysql in the Synaptic "Quick search" box, select the mysql-server package and mark it for installation (right click). Skip this step if MySQL server is already installed on your host. Type tango in the Synaptic "Quick search" box, select tango-starter, tango-db and libtango-java (right click). If you are a Tango python user, simply add the python-pytango package. Apply the selection by clicking on the Apply icon of the Synaptic main icon bar. You will be prompted for the installation of the Tango database in MySQL with a similar window

Configuring database

 

Click on "Forward" and be ready to enter your database root password. You will also be prompted for the  password used by Tango processes to connect to the database. When you will be prompted for the TANGO_HOST variable (as described in previous section), replace localhost by your host name. At the end of packages installation, one entry is added into the Tango database for the Starter device server process. The database and starter processes are also started. Nevertheless, the path used by the Starter device server to find other device server process executable is not initialized. You have to do it according to how you configure your system using the Starter device property or even better using the Astor GUI.

The Tango database and starter device server processes will automatically start each time the host is booted.

Using the Tango event system

On top of the packages listed in the previous example, you also need the notifd binary. Type omninotify in the synaptic "Quick search" box, select the omninotify package, mark it for installation (right click) and apply the selection (apply icon on the synaptic main icon bar)

Using the Tango event system and Tango access control system

On top of the packages listed in the previous example, you also need to install the Tango Controlled Access device server binary. Type tango in the Synaptic "Quick search" box, select the tango-accesscontrol

package, mark it for installation (right click) and apply the selection (apply icon on the synaptic main icon bar. This will install and start one instance of the Tango controlled access device server (named TangoAccessControl). Nevertheless, the control system configuration is not modified in order to switch to controlled access mode. To do so, refer to documentation chapter "Advanced Features"/"The Tango controlled access system"/"Running a Tango control system with the controlled access".

 

This process will automatically start each time the host is booted.

Installing a stand alone Tango development host

Installing a stand alone Tango development host means that it should be possible to compile software using Tango on this host and to test this software. To do so, you need:

  • The MySQL RDBMS
  • The Tango database server
  • The library and include files for Tango related libraries (Tango, log4tango and omniorb)
  • The Tango java tools
  • A Tango device server binary to test your system (optional)
  • The Tango book

If not already installed, install the MySQL server. Type mysql in the Synaptic "Quick search" box, select the mysql-server package and mark it for installation (right click). Type tango in the Synaptic "Quick search" box, select tango-db, libtango7-dev, libtango-java and libtango7-doc (right click). If you are a Tango python user, simply add the python-pytango package in your selection. Apply the selection by clicking on the Apply icon of the Synaptic main icon bar. If you want a Tango device server to test your system, select the tango-test package, mark it for installation (right click) and apply the changes.

Installing a Tango python development host in a distributed Tango system

Installing a Tango python development host is pretty simple. Type tango in the Synaptic "Quick search" box, select python-pytango (right click). Apply the selection by clicking on the Apply icon of the Synaptic main icon bar. That's all !!!

Remarks

Where are my files?

These packages do not define a TANGO_HOST environment variable. They are using the /etc/tangorc file to get their TANGO_HOST. The device server binaries are in /usr/lib/tango. The libraries go to the /usr/lib directory. The include files go into a /usr/include/tango directory. The tools binary (jijve, astor,..) go to /usr/bin. The java jar files are in /usr/share/java. Debugging files are in /usr/lib/debug. Scripts to start/stop processes at host reboot are in /etc/init.d. Documentation is installed in /usr/share/doc/libtango7-doc. The python-pytango files are stored in /usr/lib/pythonX.Y/dist-packages/PyTango (binding library) and in /usr/share/pyshared/PyTango.

Getting the source

It's not possible to download a source package using Synaptic. You have to use the command line. To download Tango sources, open a shell window, change the working directory to the place where you want the source package to be installed and type the following command

sudo apt-get source tango

After execution of this command, you should have 3 files in this directory. Tango sources are in the file named tango_xxxxx.orig.tar.gz

Debug packages

To use one of the binary xxx-dbg package, you need to first get the Tango source package (see previous sub-chapter). Then start a debugger and gives the directory where you have installed the source package to the debugger source file path. The exact directory to be given to the debugger depends on which package you want to debug.

Note that doing step by step debugging is an interesting experiment! Program execution looks very strange. Before reporting this as a bug, please look at this debugger documentation page.

Nevertheless, in case of process doing "core dump", these packages help to find out the exact place where the software crashes.

Conclusion

On hosts running the Ubuntu distribution of GNU/Linux, the debian packaging system and the Synaptic tool makes installing Tango a less than 5 minutes task. Therefore, there is no excuse not to do it !

Document Actions