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

have sysV init script check for actual function presence

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6, 11.8
    • None
    • Scripts & Clients
    • None
    • RHEL 8 an later, maybe others, too

    Description

      The current implementation of the sysvinit script only creates log_success_msg() and log_failure_msg() fallback functions when not finding an /etc/init.d/functions file to include.

      Newer RHEL releases do not declare those functions in that file anymore though.

      So instead of checking for file existence the init script should check for whether the functions are actually declared, and declare the fallbacks if not:

      diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
      index dd8cbd4850e..18c42ff1473 100644
      --- a/support-files/mysql.server.sh
      +++ b/support-files/mysql.server.sh
      @@ -100,11 +100,18 @@ fi
       
       if test -f $init_functions; then
         . $init_functions
      -else
      +fi
      +
      +# newer Red Hat releases don't seem to have the below functions
      +# in /etc/init.d/functions or elsewhere anymore
      +if ! type -f log_success_msg >/dev/null; then
         log_success_msg()
         {
           echo " SUCCESS! $@"
         }
      +fi
      +
      +if ! type -f log_failure_msg >/dev/null; then
         log_failure_msg()
         {
           echo " ERROR! $@"
      

      Attachments

        Activity

          People

            dbart Daniel Bartholomew
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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