Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.4.3
-
None
-
None
-
2020-4, 2020-5, 2020-6, 2020-7
Description
The new version of post-mysql-install, etc rely on systemctl, but systemd will not be running inside of a Docker container for instance.
If the systemctl binary and the mariadb.service script are present BUT systemd is not running, this will still give us a false positive. I suggest we expand the conditional check to verify if systemd is actually running.
Attachments
Issue Links
- split to
-
MCOL-4051 Clone for MCOL-3830 systemctl cat mariadb.service does not work on all systems
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description | The new version of post-mysql-install relies on systemctl which will not be available inside of a Docker container. We need to rewrite this script to work with Docker and non-Docker systems. |
The new version of post-mysql-install relies on systemctl which will not be available inside of a Docker container. We need to rewrite this script to work with Docker and non-Docker systems.
As a temporary work-around I have used the old post-mysql-install script and changed the commands mysql-Columnstore to /usr/share/mysql/mysql.server instead: {code:java} #!/bin/bash # # $Id: post-mysql-install 3661 2013-06-25 22:04:33Z dhill $ # # Post-install steps for calpont-mysql install # check log for error checkForError() { # check for password error grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then echo "MySQL Password file missing or incorrect, check .my.cnf file" rm -f ${tmpdir}/error.check /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi rm -f ${tmpdir}/error.check #--------------------------------------------------------------------------- # See if engine columnstore exist #--------------------------------------------------------------------------- echo "checking for engine columnstore..." mysql \ --user=root \ --execute='show engines;' \ | grep -i columnstore # # Add compressiontype column to SYSCOLUMN if applicable # if [ $? -ne 0 ]; then echo "columnstore doesn't exist" exit 1 fi echo "columnstore exist" return 0; } rpmmode=install tmpdir="/tmp" for arg in "$@"; do if [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then rpmmode="$(echo $arg | awk -F= '{print $2}')" elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then tmpdir="$(echo $arg | awk -F= '{print $2}')" else echo "ignoring unknown argument: $arg" 1>&2 fi done # Restart in the same way that mysqld will be started normally. /usr/share/mysql/mysql.server stop >/dev/null 2>&1 sleep 2 /usr/share/mysql/mysql.server start --skip-grant-tables sleep 5 # Install various Calpont stuff... install_mcs_mysql.sh --tmpdir=$tmpdir checkForError if [ $? -ne 0 ]; then echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi /usr/share/mysql/mysql.server stop exit 0 {code} |
Rank | Ranked higher |
Rank | Ranked higher |
Status | Open [ 1 ] | Needs Feedback [ 10501 ] |
Status | Needs Feedback [ 10501 ] | Open [ 1 ] |
Fix Version/s | 1.4.3 [ 24038 ] |
Assignee | Jose Rojas [ jrojas ] |
Fix Version/s | 1.5 [ 22800 ] |
Sprint | 2020-4 [ 392 ] |
Story Points | 1 |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Jose Rojas [ jrojas ] | Ben Thompson [ ben.thompson ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Ben Thompson [ ben.thompson ] | Jose Rojas [ jrojas ] |
Summary | post-mysql-install will not work with Docker | systemctl cat mariadb.service does not work on all systems |
Description |
The new version of post-mysql-install relies on systemctl which will not be available inside of a Docker container. We need to rewrite this script to work with Docker and non-Docker systems.
As a temporary work-around I have used the old post-mysql-install script and changed the commands mysql-Columnstore to /usr/share/mysql/mysql.server instead: {code:java} #!/bin/bash # # $Id: post-mysql-install 3661 2013-06-25 22:04:33Z dhill $ # # Post-install steps for calpont-mysql install # check log for error checkForError() { # check for password error grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then echo "MySQL Password file missing or incorrect, check .my.cnf file" rm -f ${tmpdir}/error.check /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi rm -f ${tmpdir}/error.check #--------------------------------------------------------------------------- # See if engine columnstore exist #--------------------------------------------------------------------------- echo "checking for engine columnstore..." mysql \ --user=root \ --execute='show engines;' \ | grep -i columnstore # # Add compressiontype column to SYSCOLUMN if applicable # if [ $? -ne 0 ]; then echo "columnstore doesn't exist" exit 1 fi echo "columnstore exist" return 0; } rpmmode=install tmpdir="/tmp" for arg in "$@"; do if [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then rpmmode="$(echo $arg | awk -F= '{print $2}')" elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then tmpdir="$(echo $arg | awk -F= '{print $2}')" else echo "ignoring unknown argument: $arg" 1>&2 fi done # Restart in the same way that mysqld will be started normally. /usr/share/mysql/mysql.server stop >/dev/null 2>&1 sleep 2 /usr/share/mysql/mysql.server start --skip-grant-tables sleep 5 # Install various Calpont stuff... install_mcs_mysql.sh --tmpdir=$tmpdir checkForError if [ $? -ne 0 ]; then echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi /usr/share/mysql/mysql.server stop exit 0 {code} |
The new version of post-mysql-install relies on systemctl, but systemd will not be available inside of a Docker container. We need to rewrite this script to work with system V as well as containerized environments.
As a temporary work-around I have used the old post-mysql-install script and changed the commands mysql-Columnstore to /usr/share/mysql/mysql.server instead: {code:java} #!/bin/bash # # $Id: post-mysql-install 3661 2013-06-25 22:04:33Z dhill $ # # Post-install steps for calpont-mysql install # check log for error checkForError() { # check for password error grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then echo "MySQL Password file missing or incorrect, check .my.cnf file" rm -f ${tmpdir}/error.check /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi rm -f ${tmpdir}/error.check #--------------------------------------------------------------------------- # See if engine columnstore exist #--------------------------------------------------------------------------- echo "checking for engine columnstore..." mysql \ --user=root \ --execute='show engines;' \ | grep -i columnstore # # Add compressiontype column to SYSCOLUMN if applicable # if [ $? -ne 0 ]; then echo "columnstore doesn't exist" exit 1 fi echo "columnstore exist" return 0; } rpmmode=install tmpdir="/tmp" for arg in "$@"; do if [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then rpmmode="$(echo $arg | awk -F= '{print $2}')" elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then tmpdir="$(echo $arg | awk -F= '{print $2}')" else echo "ignoring unknown argument: $arg" 1>&2 fi done # Restart in the same way that mysqld will be started normally. /usr/share/mysql/mysql.server stop >/dev/null 2>&1 sleep 2 /usr/share/mysql/mysql.server start --skip-grant-tables sleep 5 # Install various Calpont stuff... install_mcs_mysql.sh --tmpdir=$tmpdir checkForError if [ $? -ne 0 ]; then echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi /usr/share/mysql/mysql.server stop exit 0 {code} |
Description |
The new version of post-mysql-install relies on systemctl, but systemd will not be available inside of a Docker container. We need to rewrite this script to work with system V as well as containerized environments.
As a temporary work-around I have used the old post-mysql-install script and changed the commands mysql-Columnstore to /usr/share/mysql/mysql.server instead: {code:java} #!/bin/bash # # $Id: post-mysql-install 3661 2013-06-25 22:04:33Z dhill $ # # Post-install steps for calpont-mysql install # check log for error checkForError() { # check for password error grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then echo "MySQL Password file missing or incorrect, check .my.cnf file" rm -f ${tmpdir}/error.check /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi rm -f ${tmpdir}/error.check #--------------------------------------------------------------------------- # See if engine columnstore exist #--------------------------------------------------------------------------- echo "checking for engine columnstore..." mysql \ --user=root \ --execute='show engines;' \ | grep -i columnstore # # Add compressiontype column to SYSCOLUMN if applicable # if [ $? -ne 0 ]; then echo "columnstore doesn't exist" exit 1 fi echo "columnstore exist" return 0; } rpmmode=install tmpdir="/tmp" for arg in "$@"; do if [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then rpmmode="$(echo $arg | awk -F= '{print $2}')" elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then tmpdir="$(echo $arg | awk -F= '{print $2}')" else echo "ignoring unknown argument: $arg" 1>&2 fi done # Restart in the same way that mysqld will be started normally. /usr/share/mysql/mysql.server stop >/dev/null 2>&1 sleep 2 /usr/share/mysql/mysql.server start --skip-grant-tables sleep 5 # Install various Calpont stuff... install_mcs_mysql.sh --tmpdir=$tmpdir checkForError if [ $? -ne 0 ]; then echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" /usr/share/mysql/mysql.server stop sleep 2 exit 2; fi /usr/share/mysql/mysql.server stop exit 0 {code} |
The new version of post-mysql-install, etc rely on systemctl, but systemd will not be running inside of a Docker container for instance.
If the systemctl binary is present and systemd is not running, this will give us a false positive. I suggest we expand the conditional check to verify if systemd is actually running. |
Description |
The new version of post-mysql-install, etc rely on systemctl, but systemd will not be running inside of a Docker container for instance.
If the systemctl binary is present and systemd is not running, this will give us a false positive. I suggest we expand the conditional check to verify if systemd is actually running. |
The new version of post-mysql-install, etc rely on systemctl, but systemd will not be running inside of a Docker container for instance.
If the systemctl binary and the mariadb.service script are present BUT systemd is not running, this will still give us a false positive. I suggest we expand the conditional check to verify if systemd is actually running. |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Jose Rojas [ jrojas ] | Ben Thompson [ ben.thompson ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Rank | Ranked higher |
Rank | Ranked higher |
Team | ColumnStore Team |
Sprint | 2020-4 [ 392 ] | 2020-4, 2020-5 [ 392, 396 ] |
Sprint | 2020-4, 2020-5 [ 392, 396 ] | 2020-4 [ 392 ] |
Sprint | 2020-4 [ 392 ] | 2020-4, 2020-5 [ 392, 396 ] |
Sprint | 2020-4, 2020-5 [ 392, 396 ] | 2020-4, 2020-5, 2020-6 [ 392, 396, 404 ] |
Status | In Review [ 10002 ] | In Testing [ 10301 ] |
Assignee | Ben Thompson [ ben.thompson ] | Daniel Lee [ dleeyh ] |
Sprint | 2020-4, 2020-5, 2020-6 [ 392, 396, 404 ] | 2020-4, 2020-5, 2020-6, 2020-7 [ 392, 396, 404, 410 ] |
Fix Version/s | 1.4.5 [ 24424 ] | |
Fix Version/s | 1.4.4 [ 24039 ] |
Fix Version/s | 1.5.0 [ 24513 ] | |
Fix Version/s | 1.5 [ 22800 ] |
Fix Version/s | 1.4.5 [ 24424 ] |
Resolution | Fixed [ 1 ] | |
Status | In Testing [ 10301 ] | Closed [ 6 ] |
Fix Version/s | 1.5.1 [ 24514 ] | |
Fix Version/s | 1.5.0 [ 24513 ] |
Tested shutdown, postConfigure, start, restart, stop on both my develop branch and in Todd's docker container https://github.com/mariadb-corporation/mariadb-enterprise-columnstore-docker to make sure it's working on systems with and without systemd