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

Getting mysqld --help as root exits with 1

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.32
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Linux, Fedora

      Description

      I'm on Fedora and try to get verbose help as root:

      sudo /usr/libexec/mysqld --help --verbose

      It kinda works but the exit code is 1, which is not what I'd expect, since I wanted just help message.

      How to repeat:

      su -
      /usr/libexec/mysqld --help --verbose
      echo $?
      

      Actual result:
      1
      Expected result:
      0

      Reported also on http://bugs.mysql.com/bug.php?id=70058

      Proposed patch is attached.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

              I'm not sure it's a good idea. If you run "mysqld --help" you will get the exit code 0. But "mysqld --help --verbose" prints values of all variables and command-line options. To do that it reads config files and load plugins (but doesn't run them). If something will fail during this process, it'll exit with the code 1. It means that if you start the server exactly the same way — it'll fail, it won't start. And if you start the server differently — your help output was misleading, it contained different values or even a different set of options as compared to what your running server would have. This is what the exit code means — you should not trust this help output, it is not what your server will have.

              Show
              serg Sergei Golubchik added a comment - I'm not sure it's a good idea. If you run "mysqld --help" you will get the exit code 0. But "mysqld --help --verbose" prints values of all variables and command-line options. To do that it reads config files and load plugins (but doesn't run them). If something will fail during this process, it'll exit with the code 1. It means that if you start the server exactly the same way — it'll fail, it won't start. And if you start the server differently — your help output was misleading, it contained different values or even a different set of options as compared to what your running server would have. This is what the exit code means — you should not trust this help output, it is not what your server will have.
              Hide
              hhorak Honza Horak added a comment -

              Ok, thanks for the explanation.

              Show
              hhorak Honza Horak added a comment - Ok, thanks for the explanation.
              Hide
              elenst Elena Stepanova added a comment -

              Upstream bug was fixed in 5.5.38, 5.6.17, 5.7.4.

              Show
              elenst Elena Stepanova added a comment - Upstream bug was fixed in 5.5.38, 5.6.17, 5.7.4.

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  hhorak Honza Horak
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: