LSB SI Tools Getting Started

From ISP_RAS
Jump to: navigation, search

This document describes the general steps on getting started with the LSB SI Tools.

Contents

Installation

LSB SI Tools contains 2 packages:

  • lsbsi-chroot provides the core file system for the SI chroot.
  • lsbsi-tools provides the tools for running and configuring the SI chroot.

Every package is avaliable in rpm, deb and tarball. These 2 packages can be installed independently from each other. It's possible to install them on different machines and have working together.

'lsbsi-tools' Installation

Install rpm or deb package using rpm, dpkg or other package managers. For example:
 rpm -i lsbsi-tools-<version>.<architecture>.rpm 
 dpkg -i lsbsi-tools_<version>_<architecture>.deb 

In case of tarball extract 'lsbsi-tools-<version>.<architecture>.tar.gz':
 sudo tar xzfv lsbsi-tools-<version>.<architecture>.tar.gz 
Then go to 'lsbsi-tools-3.2.0' folder and run 'install.sh' script. Note, only root can run it, so use 'sudo ./install.sh'.

In case of rpm and deb package lsbsi-tools is installed into /opt/lsb/si/tools folder. In case of tarball this is the folder where you extracted lsbsi-tools package.
The folder with lsbsi-tools contains the following files:

  • si - script for launching chroot environment.
  • si-GUI - GUI wrapper for 'si' script.
  • exec_wrapper.sh - simple cript for execution commands. It's used by 'si'.
  • si_run.conf - file with launching configuration.
  • lsb-si.desktop - desktop config file.
  • lsb-si.png - icon of LSB SI.

After installation it will be possible to launch si-GUI via desktop menu item. If xdg-utils isn't installed in your system, then run si-GUI directly.
In case of absence of Qt4 library (libQtGui and libQtCore libraries) si-GUI doesn't work. Use si instead. In this case desktop menu item will refer to si too.
All this problems are recognized during intallation, so look at massages during intallation.

'lsbsi-chroot' Installation

Install rpm or deb package using rpm, dpkg or other package managers. For example:
 rpm -i lsbsi-chroot-<version>.<architecture>.rpm 
 dpkg -i lsbsi-chroot_<version>_<architecture>.deb 

In case of tarball extract 'lsbsi-chroot-<version>.<architecture>.tar.gz':
 sudo tar xzfv lsbsi-chroot-<version>.<architecture>.tar.gz 
Then go to 'lsbsi-chroot-3.2.0' folder and run 'install.sh' script using 'sudo'.

In case of rpm and deb package lsbsi-chroot is installed into /opt/lsb/si/chroot folder. In case of tarball this is the folder where you extracted lsbsi-chroot package.
After installation /opt/lsb/bin/si-chroot file will appear in your system. It adjusts, runs and checks chroot environment.
During installation lsbsi group is added. Add your user into 'lsbsi' group. Only users from lsbsi group or root can run Sample Implementation.
After installation /etc/sudoers file will be modified to allow chroot and mount for all users from the lsbsi group.

Running LSB SI Tools

Use si script and its GUI wrapper si-GUI for running chroot environment. Usage si-GUI is more comfortable, but in case of absence of Qt4 library or access to X-server it's necessary to use si script.

Usage of GUI-launcher

  • After running si-GUI you can see the following window:

LSBSI local.PNG

  • Firstly you have to choose where lsbsi-chroot has been installed. Choose 'Local Sample Implementation' if lsbsi-chroot and lsbsi-tools have been installed in the same system. Otherwise choose 'Remote Sample Implementation'.
  • In case of local SI it's necessary to specify path to the folder with chroot only (use 'Browse' button).
  • If you choose 'Remote Sample Implementation' you'll see the following window:

LSBSI remote.PNG

  • It's necessary to specify path to the chroot on the remote system and the following ssh-connection properties:
    • Hostname - hostname of the server with 'lsbsi-chroot'.
    • Port - number of port for ssh demon on the server.
    • User - the user name for ssh connection.
    • X11 forwading - X11 forwading options: normal or trusted.
    • Preferred Authentications - the mode of authentication: publickey, keyboard-interactive, password, hostable.
  • If you want to save set options mark 'Save current options'. All options will be saved in si_run.conf file.
  • Press 'Run SI' button or 'Enter' key. This will launch a terminal window (i.e. gnome-terminal or konsole) with a shell running in the SI chroot environment.
  • In case of password authentication perhaps you have to enter password.
  • If successful you'll see greeting message:

LSBSI terminal.PNG

  • That's all. You are in the LSB Sample Implementation system.

Running in Terminal

In order to run LSB SI without GUI interface it's necessary to use si script from the folder with lsbsi-tools. It's possible to specify it the following arguments:

  • -P|--path - path to LSB SI chroot (on local machine or on server).
  • -h|--host - host name of system with LSB SI chroot.
  • -p|--port - port for ssh connection to the LSB SI chroot.
  • -u|--user - user name for ssh connection.
  • -PA - preferred authentications for ssh connection: publickey, keyboard-interactive, password, hostable.
  • -X - X11 forwading option. Possible value: normal (by defualt), trusted.

The missed parameters are gotten from si_run.conf file. So sometimes it's comfortable to specify all oprions in si_run.conf file and run si without arguments.
If successful after running si you'll see a terminal window (i.e. gnome-terminal or konsole) with a shell running in the SI chroot environment.
In case of some errors you'll see problem desciption in this terminal.

Application Testing with LSB SI

If you want to test some application in LSB-conforming environment (in the LSB Sample Implementation system), follow the next steps:

  1. Downdload here the last versions of lsbsi-tools and lsbsi-chroot packages.
  2. Install lsbsi-tools and lsbsi-chroot packages (see here for details). Note, they can be installed on differnet systems. In case of rpm and deb the folders with installed packages are /opt/lsb/si/tools and /opt/lsb/si/chroot.
  3. Copy the application for test to the folder where lsbsi-chroot has been installed.
  4. In case of remote installation of lsbsi-chroot be sure that ssh demon is run here (use /etc/init.d/sshd status).
  5. Run LSB SI from desktop menu from 'Development' or 'Programming' section or run si-Gui or si from the folder with lsbsi-tools.
  6. Adjust running options (see Usage of GUI-launcher or Running in Terminal).
  7. If success you'll see a terminal window with greeting. If failed the description of the problem will appear instead of greeting. The following messages you can see in the terminal:
    • Welcome to the LSB Sample Implementation 3.2 - all is successful, you are in the LSB SI system and everything is ready to work.
    • Can't find 'opt/lsb/bin/si-chroot' file... - it means that lsbsi-chroot isn't installed on your system but you chose "Local Sample Implemenation". Install lsbsi-chroot or choose "Remote Sample Implemenation" and specify options for ssh connection.
    • 'some' user isn't root and isn't in the 'lsbsi' group... - add your user into lsbsi group or run SI as root.
    • Invalid path to chroot environment - you specified non-existent path to lsbsi-chroot folder.
    • 'some' folder doesn't contain LSB SI (chroot) - you specified the folder that doesn't contain lsbsi-chroot.
    • Some ssh messages like Name or service not known, permission denied, - check your shh connection options. Be sure that ssh demon is run on remot system.
  8. After successful running LSB SI you can launch your application (that you copied in the 3 item) and investigate its behaviour in the LSB SI system.

Troubleshooting

  • Current version doesn't support SE Linux, so we recommend to disable SE Linux before launching LSB SI.
  • If after launching LSB SI via desktop menu nothing happens, run it from terminal ([lsbsi-tools-path]/si-GUI or [lsbsi-tools-path]/si) and look at error messages.
  • Running via desktop menu can lead to invalid chroot environment (this is so on Fedora 9). The reason is that /etc/sudoers contains 'Defaults requiretty' string. It means that sudo command can be executed only from terminal. If you have this feature you'll see corresponding warning while installing 'lsbsi-tools'. There are several ways to avoid this problem:
    • Comment 'Defaults requiretty' string in /etc/sudoers.
    • Change the type of application in 'Launcher Properties' of corresponding menu item. Set type as 'Application in Terminal' (this is avaliable in Gnome).
    • Launch LSB SI via terminal. Use /opt/lsb/si/tools/si in case of rpm or deb installation or run ./si in the folder where you extracted lsbsi-tools.tar.gz file.

Unininstall

For uninstalling rpm and deb use 'rpm -e' or 'dpkg -r' commands. For uninstalling tarball, enter into corresponding folders and run 'sudo ./uninstall.sh'.

Personal tools