Completely remove MariaDB or MySQL from CentOS 7 or RHEL 7

These steps are working on CentOS 6.5 so they should work on CentOS 7 too: (EDIT – exactly the same steps work for MariaDB 10.3 on CentOS 8) yum remove mariadb mariadb-server rm -rf /var/lib/mysql If your datadir in /etc/my.cnf points to a different directory, remove that directory instead of /var/lib/mysql rm /etc/my.cnf the file … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)