Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3830

systemctl cat mariadb.service does not work on all systems

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.4.3
    • 1.5.1
    • 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

          Activity

            toddstoffel Todd Stoffel (Inactive) created issue -
            toddstoffel Todd Stoffel (Inactive) made changes -
            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}
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            LinuxJedi Andrew Hutchings (Inactive) made changes -
            Status Open [ 1 ] Needs Feedback [ 10501 ]
            LinuxJedi Andrew Hutchings (Inactive) made changes -
            Status Needs Feedback [ 10501 ] Open [ 1 ]
            David.Hall David Hall (Inactive) made changes -
            Fix Version/s 1.4.3 [ 24038 ]
            David.Hall David Hall (Inactive) made changes -
            Assignee Jose Rojas [ jrojas ]
            David.Hall David Hall (Inactive) made changes -
            Fix Version/s 1.5 [ 22800 ]
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4 [ 392 ]
            David.Hall David Hall (Inactive) made changes -
            Story Points 1
            jrojas Jose Rojas (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jrojas Jose Rojas (Inactive) made changes -
            Assignee Jose Rojas [ jrojas ] Ben Thompson [ ben.thompson ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            jrojas Jose Rojas (Inactive) made changes -
            Assignee Ben Thompson [ ben.thompson ] Jose Rojas [ jrojas ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Summary post-mysql-install will not work with Docker systemctl cat mariadb.service does not work on all systems
            toddstoffel Todd Stoffel (Inactive) made changes -
            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}
            toddstoffel Todd Stoffel (Inactive) made changes -
            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.
            toddstoffel Todd Stoffel (Inactive) made changes -
            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.
            jrojas Jose Rojas (Inactive) made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            jrojas Jose Rojas (Inactive) made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            jrojas Jose Rojas (Inactive) made changes -
            Assignee Jose Rojas [ jrojas ] Ben Thompson [ ben.thompson ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Team ColumnStore Team
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4 [ 392 ] 2020-4, 2020-5 [ 392, 396 ]
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4, 2020-5 [ 392, 396 ] 2020-4 [ 392 ]
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4 [ 392 ] 2020-4, 2020-5 [ 392, 396 ]
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4, 2020-5 [ 392, 396 ] 2020-4, 2020-5, 2020-6 [ 392, 396, 404 ]
            ben.thompson Ben Thompson (Inactive) made changes -
            Status In Review [ 10002 ] In Testing [ 10301 ]
            ben.thompson Ben Thompson (Inactive) made changes -
            Assignee Ben Thompson [ ben.thompson ] Daniel Lee [ dleeyh ]

            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

            jrojas Jose Rojas (Inactive) added a comment - 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
            David.Hall David Hall (Inactive) made changes -
            Sprint 2020-4, 2020-5, 2020-6 [ 392, 396, 404 ] 2020-4, 2020-5, 2020-6, 2020-7 [ 392, 396, 404, 410 ]
            David.Hall David Hall (Inactive) made changes -
            Fix Version/s 1.4.5 [ 24424 ]
            Fix Version/s 1.4.4 [ 24039 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 1.5.0 [ 24513 ]
            Fix Version/s 1.5 [ 22800 ]

            Build verified: 1.5.0-1 (drone 20200610, build 65, commit eeb3c842)

            Verified lentos 9 and 10, ubuntu 18 and 20

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: 1.5.0-1 (drone 20200610, build 65, commit eeb3c842) Verified lentos 9 and 10, ubuntu 18 and 20
            dleeyh Daniel Lee (Inactive) made changes -
            Fix Version/s 1.4.5 [ 24424 ]

            Testing for 1.4.5-1 is being tracked on MCOL-4051. Closing this one for 1.5.0-1.

            dleeyh Daniel Lee (Inactive) added a comment - Testing for 1.4.5-1 is being tracked on MCOL-4051 . Closing this one for 1.5.0-1.
            dleeyh Daniel Lee (Inactive) made changes -
            Resolution Fixed [ 1 ]
            Status In Testing [ 10301 ] Closed [ 6 ]
            David.Hall David Hall (Inactive) made changes -
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 1.5.1 [ 24514 ]
            Fix Version/s 1.5.0 [ 24513 ]

            People

              dleeyh Daniel Lee (Inactive)
              toddstoffel Todd Stoffel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.