Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Usage
This chapter describes the necessary steps for rebuilding and using Red Hat Software Collections 3.3, and deploying applications that use Red Hat Software Collections.
3.1. Using Red Hat Software Collections
3.1.1. Running an Executable from a Software Collection
To run an executable from a particular Software Collection, type the following command at a shell prompt:
scl enable software_collection... 'command...'
Or, alternatively, use the following command:
scl enable software_collection... -- command...
Replace software_collection with a space-separated list of Software Collections you want to use and command with the command you want to run. For example, to execute a Perl program stored in a file named
hello.pl
with the Perl interpreter from the perl526 Software Collection, type:
~]$ scl enable rh-perl526 'perl hello.pl'
Hello, World!
You can execute any command using the
scl
utility, causing it to be run with the executables from a selected Software Collection in preference to their possible Red Hat Enterprise Linux system equivalents. For a complete list of Software Collections that are distributed with Red Hat Software Collections, see Table 1.1, “Red Hat Software Collections 3.3 Components”.
3.1.2. Running a Shell Session with a Software Collection as Default
To start a new shell session with executables from a selected Software Collection in preference to their Red Hat Enterprise Linux equivalents, type the following at a shell prompt:
scl enable software_collection... bash
Replace software_collection with a space-separated list of Software Collections you want to use. For example, to start a new shell session with the python27 and rh-postgresql10 Software Collections as default, type:
~]$ scl enable python27 rh-postgresql10 bash
The list of Software Collections that are enabled in the current session is stored in the
$X_SCLS
environment variable, for instance:
~]$ echo $X_SCLS
python27 rh-postgresql10
For a complete list of Software Collections that are distributed with Red Hat Software Collections, see Table 1.1, “Red Hat Software Collections 3.3 Components”.
3.1.3. Running a System Service from a Software Collection
Running a System Service from a Software Collection in Red Hat Enterprise Linux 6
Software Collections that include system services install corresponding init scripts in the
/etc/rc.d/init.d/
directory. To start such a service in the current session, type the following at a shell prompt as root
:
service software_collection-service_name start
Replace software_collection with the name of the Software Collection and service_name with the name of the service you want to start.
To configure this service to start automatically at boot time, type the following command as
root
:
chkconfig software_collection-service_name on
For example, to start the
postgresql
service from the rh-postgresql96 Software Collection and enable it in runlevels 2, 3, 4, and 5, type as root
:
~]#service rh-postgresql96-postgresql start
Starting rh-postgresql96-postgresql service: [ OK ] ~]#chkconfig rh-postgresql96-postgresql on
For more information on how to manage system services in Red Hat Enterprise Linux 6, refer to the Red Hat Enterprise Linux 6 Deployment Guide. For a complete list of Software Collections that are distributed with Red Hat Software Collections, see Table 1.1, “Red Hat Software Collections 3.3 Components”.
Running a System Service from a Software Collection in Red Hat Enterprise Linux 7
In Red Hat Enterprise Linux 7, init scripts have been replaced by
systemd
service unit files, which end with the .service
file extension and serve a similar purpose as init scripts. To start a service in the current session, execute the following command as root
:
systemctl start software_collection-service_name.service
Replace software_collection with the name of the Software Collection and service_name with the name of the service you want to start.
To configure this service to start automatically at boot time, type the following command as
root
:
systemctl enable software_collection-service_name.service
For example, to start the
postgresql
service from the rh-postgresql10 Software Collection and enable it at boot time, type as root
:
~]#systemctl start rh-postgresql10-postgresql.service
~]#systemctl enable rh-postgresql10-postgresql.service
For more information on how to manage system services in Red Hat Enterprise Linux 7, refer to the Red Hat Enterprise Linux 7 System Administrator's Guide. For a complete list of Software Collections that are distributed with Red Hat Software Collections, see Table 1.1, “Red Hat Software Collections 3.3 Components”.
3.2. Accessing a Manual Page from a Software Collection
Every Software Collection contains a general manual page that describes the content of this component. Each manual page has the same name as the component and it is located in the
/opt/rh
directory.
To read a manual page for a Software Collection, type the following command:
scl enable software_collection 'man software_collection'
Replace software_collection with the particular Red Hat Software Collections component. For example, to display the manual page for rh-mariadb102, type:
~]$ scl enable rh-mariadb102 "man rh-mariadb102"
3.3. Deploying Applications That Use Red Hat Software Collections
In general, you can use one of the following two approaches to deploy an application that depends on a component from Red Hat Software Collections in production:
- Install all required Software Collections and packages manually and then deploy your application, or
- Create a new Software Collection for your application and specify all required Software Collections and other packages as dependencies.
For more information on how to manually install individual Red Hat Software Collections components, see Section 2.2, “Installing Red Hat Software Collections”. For further details on how to use Red Hat Software Collections, see Section 3.1, “Using Red Hat Software Collections”. For a detailed explanation of how to create a custom Software Collection or extend an existing one, read the Red Hat Software Collections Packaging Guide.
3.4. Red Hat Software Collections Container Images
Container images based on Red Hat Software Collections include applications, daemons, and databases. The images can be run on Red Hat Enterprise Linux 7 Server and Red Hat Enterprise Linux Atomic Host. For information about their usage, see Using Red Hat Software Collections 3 Container Images. For details regarding container images based on Red Hat Software Collections versions 2.4 and earlier, see Using Red Hat Software Collections 2 Container Images.
The following container images are available with Red Hat Software Collections 3.3:
- rhscl/mariadb-103-rhel7
- rhscl/redis-5-rhel7
- rhscl/ruby-26-rhel7
- rhscl/devtoolset-8-toolchain-rhel7
- rhscl/devtoolset-8-perftools-rhel7
- rhscl/varnish-6-rhel7
- rhscl/httpd-24-rhel7
The following container images are based on Red Hat Software Collections 3.2:
- rhscl/mysql-80-rhel7
- rhscl/nginx-114-rhel7
- rhscl/php-72-rhel7
The following container images are based on Red Hat Software Collections 3.1:
- rhscl/devtoolset-7-toolchain-rhel7
- rhscl/devtoolset-7-perftools-rhel7
- rhscl/mongodb-36-rhel7
- rhscl/perl-526-rhel7
- rhscl/php-70-rhel7
- rhscl/postgresql-10-rhel7
- rhscl/ruby-25-rhel7
- rhscl/varnish-5-rhel7
The following container images are based on Red Hat Software Collections 3.0:
- rhscl/mariadb-102-rhel7
- rhscl/mongodb-34-rhel7
- rhscl/nginx-112-rhel7
- rhscl/nodejs-8-rhel7
- rhscl/php-71-rhel7
- rhscl/postgresql-96-rhel7
- rhscl/python-36-rhel7
The following container images are based on Red Hat Software Collections 2.4:
- rhscl/devtoolset-6-toolchain-rhel7 (EOL)
- rhscl/devtoolset-6-perftools-rhel7 (EOL)
- rhscl/nginx-110-rhel7
- rhscl/nodejs-6-rhel7 (EOL)
- rhscl/python-27-rhel7
- rhscl/ruby-24-rhel7
- rhscl/ror-50-rhel7
- rhscl/thermostat-16-agent-rhel7 (EOL)
- rhscl/thermostat-16-storage-rhel7 (EOL)
The following container images are based on Red Hat Software Collections 2.3:
- rhscl/mysql-57-rhel7
- rhscl/perl-524-rhel7
- rhscl/redis-32-rhel7
- rhscl/mongodb-32-rhel7 (EOL)
- rhscl/php-56-rhel7 (EOL)
- rhscl/python-35-rhel7 (EOL)
- rhscl/ruby-23-rhel7 (EOL)
The following container images are based on Red Hat Software Collections 2.2:
- rhscl/devtoolset-4-toolchain-rhel7 (EOL)
- rhscl/devtoolset-4-perftools-rhel7 (EOL)
- rhscl/mariadb-101-rhel7 (EOL)
- rhscl/nginx-18-rhel7 (EOL)
- rhscl/nodejs-4-rhel7 (EOL)
- rhscl/postgresql-95-rhel7 (EOL)
- rhscl/ror-42-rhel7 (EOL)
- rhscl/thermostat-1-agent-rhel7 (EOL)
- rhscl/varnish-4-rhel7 (EOL)
The following container images are based on Red Hat Software Collections 2.0:
- rhscl/mariadb-100-rhel7 (EOL)
- rhscl/mongodb-26-rhel7 (EOL)
- rhscl/mysql-56-rhel7 (EOL)
- rhscl/nginx-16-rhel7 (EOL)
- rhscl/passenger-40-rhel7 (EOL)
- rhscl/perl-520-rhel7 (EOL)
- rhscl/postgresql-94-rhel7 (EOL)
- rhscl/python-34-rhel7 (EOL)
- rhscl/ror-41-rhel7 (EOL)
- rhscl/ruby-22-rhel7 (EOL)
- rhscl/s2i-base-rhel7
Images marked as End of Life (EOL) are no longer supported.