Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

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
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat