Docker CE on RHEL – Requires: container-selinux >= 2.9

The container-selinux package is available from the rhel-7-server-extras-rpms channel. You can enable it using: subscription-manager repos –enable=rhel-7-server-extras-rpms Sources for the package have been exported to git.centos.org, too, so you could rebuild it yourself using mock: https://git.centos.org/summary/rpms!container-selinux.git (This is not a programming question, so you should use one of the other sites.)

Best practice to run Linux service as a different user

On Debian we use the start-stop-daemon utility, which handles pid-files, changing the user, putting the daemon into background and much more. I’m not familiar with RedHat, but the daemon utility that you are already using (which is defined in /etc/init.d/functions, btw.) is mentioned everywhere as the equivalent to start-stop-daemon, so either it can also change … Read more

Installing Python 3 on RHEL

Installing from RPM is generally better, because: you can install and uninstall (properly) python3. the installation time is way faster. If you work in a cloud environment with multiple VMs, compiling python3 on each VMs is not acceptable. Solution 1: Red Hat & EPEL repositories Red Hat has added through the EPEL repository: Python 3.4 … Read more

How to redirect output of systemd service to a file

I think there’s a more elegant way to solve the problem: send the stdout/stderr to syslog with an identifier and instruct your syslog manager to split its output by program name. Use the following properties in your systemd service unit file: StandardOutput=syslog StandardError=syslog SyslogIdentifier=<your program identifier> # without any quote Then, assuming your distribution is … Read more