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

mysqld_safe script breaks with many versions of grep

    XMLWordPrintable

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

          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.