Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29222

mysqld_safe script breaks with many versions of grep

Details

    Description

      When running the mysqld_safe start command, if the grep command isn't the exact correct version, it will fail with the following error:

      grep: mysqld_safe: No such file or directory
      

      This is a problem, as the script should not assume that the grep command that is installed should have all the features.
      It is failing with very common versions of grep, like GNU grep v3.7


      This was broken in commit 193bfdd831bbbf65e74acd12baf691d4305e3c11.

      The offending line of code is in server/scripts/CMakeLists.txt:

        # FIND_PROC and CHECK_PID are used by mysqld_safe
      IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
        SET (FIND_PROC
          "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
      

      This could be fixed by changing the middle grep command from

      grep -vE mariadbd-safe -vE mysqld_safe
      

      To the new command:

      grep -vE "mariadbd-safe|mysqld_safe"
      

      Attachments

        Activity

          agourluck Addison Gourluck created issue -
          agourluck Addison Gourluck made changes -
          Field Original Value New Value
          Description When running the `mysqld_safe start` command, if the `grep` command which is installed on the operating system is not fully functional, for example the `busybox` version, then the mysql command will fail with the following error:

          ```
          grep: mysqld_safe: No such file or directory
          ```

          This was broken in commit 193bfdd831bbbf65e74acd12baf691d4305e3c11.

          The offending line of code is in `server/scripts/CMakeLists.txt`:

          ```
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          ```
          When running the {{mysqld_safe start}} command, if the `grep` command which is installed on the operating system is not fully functional, for example the `busybox` version, then the mysql command will fail with the following error:


          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit 193bfdd831bbbf65e74acd12baf691d4305e3c11.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          ```
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          ```
          agourluck Addison Gourluck made changes -
          Description When running the {{mysqld_safe start}} command, if the `grep` command which is installed on the operating system is not fully functional, for example the `busybox` version, then the mysql command will fail with the following error:


          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit 193bfdd831bbbf65e74acd12baf691d4305e3c11.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          ```
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          ```
          When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}
          agourluck Addison Gourluck made changes -
          Summary mysqld_safe script breaks if grep is not fully functional mysqld_safe script breaks if grep is not fully featured
          agourluck Addison Gourluck made changes -
          Description When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}
          When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          agourluck Addison Gourluck made changes -
          Description When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This is a problem, as the script should not assume that the {{grep}} command that is installed should have all the features.

          ---

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          agourluck Addison Gourluck made changes -
          Description When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This is a problem, as the script should not assume that the {{grep}} command that is installed should have all the features.

          ---

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This is a problem, as the script should not assume that the {{grep}} command that is installed should have all the features.

          ----

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          agourluck Addison Gourluck made changes -
          Summary mysqld_safe script breaks if grep is not fully featured mysqld_safe script breaks with many versions of grep
          agourluck Addison Gourluck made changes -
          Description When running the {{mysqld_safe start}} command, if the {{grep}} command which is installed on the operating system is not fully functional, for example the {{busybox}} version, then the mysql command will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This is a problem, as the script should not assume that the {{grep}} command that is installed should have all the features.

          ----

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          When running the {{mysqld_safe start}} command, if the {{grep}} command isn't the exact correct version, it will fail with the following error:

          {code:shell}
          grep: mysqld_safe: No such file or directory
          {code}

          This is a problem, as the script should not assume that the {{grep}} command that is installed should have all the features.
          It is failing with very common versions of grep, like GNU grep v3.7

          ----

          This was broken in commit {{193bfdd831bbbf65e74acd12baf691d4305e3c11}}.

          The offending line of code is in {{server/scripts/CMakeLists.txt}}:

          {code:shell}
            # FIND_PROC and CHECK_PID are used by mysqld_safe
          IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
            SET (FIND_PROC
              "ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
          {code}

          This could be fixed by changing the middle grep command from

          {code:shell}
          grep -vE mariadbd-safe -vE mysqld_safe
          {code}

          To the new command:

          {code:shell}
          grep -vE "mariadbd-safe|mysqld_safe"
          {code}
          agourluck Addison Gourluck made changes -
          Component/s Scripts & Clients [ 11002 ]
          Component/s Server [ 13907 ]
          agourluck Addison Gourluck made changes -
          Labels beginner-friendly
          serg Sergei Golubchik made changes -
          Assignee Rucha Deodhar [ rucha174 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Rucha Deodhar [ rucha174 ] Vicențiu Ciorbaru [ cvicentiu ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Fix Version/s 10.6.9 [ 27507 ]
          Fix Version/s 10.7.5 [ 27505 ]
          Fix Version/s 10.8.4 [ 27503 ]
          Fix Version/s 10.9.2 [ 27115 ]
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            cvicentiu Vicențiu Ciorbaru
            agourluck Addison Gourluck
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.