Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Use Software Collections without Bothering with Alternative Path

October 18, 2017
Honza Horak
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

Share:

    Software Collections (SCL) give you the power to build, install, and use multiple versions of software on the same system, without affecting system-wide installed packages. Therefore, the Software Collections packaging technique is used a lot for building stacks for Red Hat Enterprise Linux and CentOS, especially dynamic languages (Python, Ruby, NodeJS) or databases (PostgreSQL, MariaDB, MongoDB).

    Avoiding Conflicts

    The SCL technique is based on avoiding conflicts on three levels:

    • Filesystem (files are put into an alternate directory under /opt/rh)
    • RPM package name (all packages names are prefixed by the collection name)
    • RPM metadata (especially provides should be unique, so SCL packages do not influence the packages from base system)

    In order to use the Software Collections packages, users need to do "few things" differently than with normal RPMs. For example, they need to use 'scl enable' call, which changes environment variables like PATH or LD_LIBRARY_PATH, so that binaries under alternative path are found. Users also need to use different names for systemd services. Or, some scripts might use full paths for the binaries, like /usr/bin/mysql, so these scripts may not work with Software Collections. Although many things will work without users even notice they use SCL, there can be some issues like that.

    Unfortunately, it's not easy to solve these issues, because we would lose the ability to not influence the base system underneath, the main feature of Software Collections technology.

    When conflicts are no problem

    However, in the latest Red Hat Software Collections release 3.0, the new database collections (PostgreSQL 9.6, MariaDB 10.2, and MongoDB 3.4) use a new concept called "syspaths". This concept allows users still to consume different versions of packages without influencing the other environment but optionally allows them to use the RPM packages as any other package. It feels like the Software Collections technology would not be used at all, which allows users to choose, whether they prefer isolation or usage simplicity.

    The concept of syspaths is simply enabled by installing optional packages called *-syspaths, for example, rh-mariadb102-syspaths. These packages deliver shell wrappers in the first place, that is deliberately installed into a standard path (typically /usr/bin). That means that installation of these packages obviously breaks the feature of isolation SCL from the rest of the system. On the other hand, not everybody requires installing and especially run more versions of the same package on one system at the same time, which is especially the case for the database servers.

    Wrapper shell script for binaries and variable files

    So, what all changes we can see after installing the *-syspaths package? First obvious thing is having few binaries (executable shell scripts) in /usr/bin as mentioned above. Thanks to that, users can simply run mysql or mysqladmin without the need to use 'scl enable' before. The trick is not any magic, the wrapper in '/usr/bin' simply sets the correct environment and executes the original binary that still lives in /opt/rh.

    The fact that we use shell wrappers does not allow us to do everything that we can do with original binary though. For example for debugging binaries using gdb, we need to use the full path in /opt/rh, because gdb would not be happy with the wrapper shell script.

    Anyway, the binaries are not the only thing that we put outside of /opt, /etc/opt/, or /var/opt/ directories. For example, the path to the database files (originally in /var/opt/rh/rh-mariadb102/lib/mysql in case of MariaDB 10.2 SCL) will be discovered easier now, because the symlink lives in the path that users would usually look into -- under /var/lib. However, we can't simply create a symlink called /var/lib/mysql, because that directory may still include data from the system database, and we really do not want to play with any user's data. What's more, RPM wouldn't like the mixture of symlink and directory for the same path.

    So, the symlink is rather called /var/lib/rh-mariadb102-mysql and similarly, for the log file location, the symlink is called /var/log/rh-mariadb102-mariadb (you see the pattern `//-`). Nevertheless, the name itself is not important; as said before, what is important here is that the files will be found easily when looking into /var/lib, or /var/log.

    Configure files and services

    Do you want more from the syspaths feature? Here it is -- the same concept as for the variable files is used for the configuration files as well; the symbolic links called rh-mariadb102-my.cnf and rh-mariadb102-my.cnf.d can be easily found in /etc. Again, that should help to locate the configuration files.

    Systemd and SysV init services are another entry point to the database services that users interact. Users generally do not need to use 'scl enable' when starting the service, because services are by design started in a clean environment. Still, users need to use the correct name, which is usually prefixed by SCL name (rh-mariadb102-mariadb in case of MariaDB 10.2 when no syspaths package is installed). The syspaths feature allows users to use the normal names for the services, like mariadb, mongod, or postgresql, when the syspaths package is installed. And yes, it means that running `systemctl start mariadb` will just work.

    As a result, all these enhancements should not only help users to use the new database collections easier in the terminal, but also any existing scripts should not need changes anymore. Just don't forget that the *-syspaths packages obviously conflict with the packages from the base system, so the system packages cannot be installed together with the syspaths packages. If that is a problem for you, but you still want to use the *-syspaths packages, you might also consider container technology (like Docker) to avoid the conflicts. In that case, you would install *-syspaths packages into the container, but no conflicting packages from the base system.

    Feedback welcome

    What else? Well, enjoy the new *-syspaths feature and provide us with your feedback either here or on sclorg@redhat.com mailing list.


    Join the Red Hat Developer Program (it’s free) and get access to related cheat sheets, books, and product downloads.


    Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

    Last updated: November 1, 2023

    Recent Posts

    • Ollama or vLLM? How to choose the right LLM serving tool for your use case

    • How to build a Model-as-a-Service platform

    • How Quarkus works with OpenTelemetry on OpenShift

    • Our top 10 articles of 2025 (so far)

    • The benefits of auto-merging GitHub and GitLab repositories

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue