Este contenido no está disponible en el idioma seleccionado.

3.5. Using Software Collections over NFS


In some environments, the requirement is often to have a centralized model for how applications and tools are distributed rather than allowing users to install the application or tool version they prefer. In this way, NFS is the common method of mounting centrally managed software.
To use a Software Collection over NFS, you need to define a Software Collection macro nfsmountable. If you define the macro when building a Software Collection, the resulting Software Collection has its state files and configuration files located outside the Software Collection's /opt file system hierarchy. This enables you to mount the /opt file system hierarchy over NFS as read-only.
To build a Software Collection with the nfsmountable macro defined, run the following command:
 rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1' 
Copy to Clipboard Toggle word wrap
where software_collection is the name of the Software Collection. Defining the macro changes the values for the _sysconfdir, _sharedstatedir, and _localstatedir macros. The changed values are detailed in the following table.
Expand
Table 3.1. Changed Values for Software Collection Macros
Macro
Original definition
Expanded value for the original definition
Changed definition
Expanded value for the changed definition
_sysconfdir
%{_scl_root}/etc
/opt/provider/%{scl}/root/etc
%{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}
/etc/opt/provider/scls/%{scl}
_sharedstatedir
%{_scl_root}/var/lib
/opt/provider/%{scl}/root/var/lib
%{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib
/var/opt/provider/scls/%{scl}/lib
_localstatedir
%{_scl_root}/var
/opt/provider/%{scl}/root/var
%{_root_localstatedir}%{_scl_prefix}/scls/%{scl}
/var/opt/provider/scls/%{scl}
Note that the expanded values for the changed definitions contain a /scls directory in their paths.

3.5.1. Changed Directory Structure and File Ownership

The nfsmountable macro also has an impact on how the scl_install and scl_files macros create a directory structure and set the file ownership when you run the rpmbuild command.
For example, a directory structure of a Software Collection named software_collection looks as follows:
$ rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'
...
$ rpm -qlp software_collection-runtime-1-1.el6.x86_64
/etc/opt/provider/scls/software_collection
/etc/opt/provider/scls/software_collection/X11
/etc/opt/provider/scls/software_collection/X11/applnk
/etc/opt/provider/scls/software_collection/X11/fontpath.d
...
/opt/provider/software_collection/root/usr/src
/opt/provider/software_collection/root/usr/src/debug
/opt/provider/software_collection/root/usr/src/kernels
/opt/provider/software_collection/root/usr/tmp
/var/opt/provider/scls/software_collection
/var/opt/provider/scls/software_collection/cache
/var/opt/provider/scls/software_collection/db
/var/opt/provider/scls/software_collection/empty
...
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat