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

mysqld_safe start does not give back prompt on succes when running with --user option

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0.21
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Debian 7 (Wheezy)

      Description

      I recently installed an instance of Maria DB 10.0.21 on my laptop from a tarball (with glibc) and went through my installation fine but when trying to start the daemon with --user=mariadb (as this is the user I'm using for the db server) the prompt keeps adding dots to the "Starting MySQL" message without ever stopping even though in the log file

      {hostname}

      .err I can see that it successfully started and mysqld_safe status returns a "running" message.

      I haven't tried to do it with the standard mysql user so I don't know if it happens with the standard user, I guess not because I did not see another bug report for a similar case in JIRA.

      Note : I was previously using MySQL server 5.6 with the standard user.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rrajkomar Ryan RAJKOMAR added a comment -

            Note that I just ran the same process as the one causing the issue on a similar instance with the one difference that I used the standard mysql user and did not experience the same issue.

            So is it normal behaviour that I would not get back the shell prompt when using another user ? Does the same also happen with a Mysql install ?

            In the meantime I'll use the standard user although I do not like having to use a "mysql" for a "mariadb" server.

            Show
            rrajkomar Ryan RAJKOMAR added a comment - Note that I just ran the same process as the one causing the issue on a similar instance with the one difference that I used the standard mysql user and did not experience the same issue. So is it normal behaviour that I would not get back the shell prompt when using another user ? Does the same also happen with a Mysql install ? In the meantime I'll use the standard user although I do not like having to use a "mysql" for a "mariadb" server.
            Hide
            rrajkomar Ryan RAJKOMAR added a comment - - edited

            After retrying once more without changing too much configuration i found were the problem originated : it happens when I change the name of the socket file from /tmp/mysql.sock to anything else like /tmp/mariab.sock

            When using the default /tm/mysql.sock there's no issue at all, but as soon as I change it, I can't get back the shell prompt when starting the instance even though it starts fine.

            Show
            rrajkomar Ryan RAJKOMAR added a comment - - edited After retrying once more without changing too much configuration i found were the problem originated : it happens when I change the name of the socket file from /tmp/mysql.sock to anything else like /tmp/mariab.sock When using the default /tm/mysql.sock there's no issue at all, but as soon as I change it, I can't get back the shell prompt when starting the instance even though it starts fine.
            Hide
            elenst Elena Stepanova added a comment -

            Ryan RAJKOMAR,

            Sorry, I don't quite understand what you mean. mysqld_safe (or mysqld) never returns the prompt if it's started successfully, you need to run it in background. It is true for MariaDB and for MySQL, for new and old versions.
            It only returns the prompt when it fails to start.
            Please provide the exact complete command line you are using to run it – when it does and does not return the prompt, and also quote the error log in both cases.

            Show
            elenst Elena Stepanova added a comment - Ryan RAJKOMAR , Sorry, I don't quite understand what you mean. mysqld_safe (or mysqld) never returns the prompt if it's started successfully, you need to run it in background. It is true for MariaDB and for MySQL, for new and old versions. It only returns the prompt when it fails to start. Please provide the exact complete command line you are using to run it – when it does and does not return the prompt, and also quote the error log in both cases.
            Hide
            rrajkomar Ryan RAJKOMAR added a comment - - edited

            Sorry my bad indeed it wasn't very clear : I did not run any mysqld* command directly, I copied the mysql.server file into the /etc/init.d directory and simply updated the basedir and datadir entries before running a /etc/init.d/

            {my_file} start

            Prior to that I had copied one of the my-*.cnf files from the support_files directory into my mariadb data directory and simply changed the socket entry to another filename : /tmp/mysql.sock became /tmp/mariadb.sock and that's when the "/etc/init.d/{my_file}

            start" command stopped giving me back the prompt.

            I hope it is clearer this time. If not, please do not hesitate.

            Show
            rrajkomar Ryan RAJKOMAR added a comment - - edited Sorry my bad indeed it wasn't very clear : I did not run any mysqld* command directly, I copied the mysql.server file into the /etc/init.d directory and simply updated the basedir and datadir entries before running a /etc/init.d/ {my_file} start Prior to that I had copied one of the my-*.cnf files from the support_files directory into my mariadb data directory and simply changed the socket entry to another filename : /tmp/mysql.sock became /tmp/mariadb.sock and that's when the "/etc/init.d/{my_file} start" command stopped giving me back the prompt. I hope it is clearer this time. If not, please do not hesitate.
            Hide
            elenst Elena Stepanova added a comment -

            Thanks, it's clearer now, although there are still some questions; but I hope they won't be necessary.

            I assume by "not returning prompt" you mean that the script keeps printing the dots in

            Starting MySQL
            ....................
            

            and that you haven't tried to wait for 15 minutes to have it failed due to the timeout?

            If so, the reason seems simple from your description. You changed the socket in the cnf file and put it in your basedir.
            What the script does is start the server first, and then ping it using mysqladmin until it responds.
            The server can pick up the config from the basedir, but mysqladmin does not. So, while the server is running with /tmp/mariadb.sock, mysqladmin tries to ping it on /tmp/mysql.sock and never can. To fix it, you need to put the cnf file in one of default locations, e.g. /etc/mysql/my.cnf.

            Now, regarding why it works for you in case of a default user, I don't have an answer for that. There can be lots of guesses, none of which is good, but probably it would be easier for you just to check your configuration and you'll see right away. Check whether /tmp/mysql.sock and /tmp/mariadb.sock exist when you run with the default user, which one the server uses, which one mysqladmin uses, etc. If you can't figure it out, please let me know, I'll try to think of some diagnostics to investigate it.

            Show
            elenst Elena Stepanova added a comment - Thanks, it's clearer now, although there are still some questions; but I hope they won't be necessary. I assume by "not returning prompt" you mean that the script keeps printing the dots in Starting MySQL .................... and that you haven't tried to wait for 15 minutes to have it failed due to the timeout? If so, the reason seems simple from your description. You changed the socket in the cnf file and put it in your basedir. What the script does is start the server first, and then ping it using mysqladmin until it responds. The server can pick up the config from the basedir, but mysqladmin does not. So, while the server is running with /tmp/mariadb.sock, mysqladmin tries to ping it on /tmp/mysql.sock and never can. To fix it, you need to put the cnf file in one of default locations, e.g. /etc/mysql/my.cnf. Now, regarding why it works for you in case of a default user, I don't have an answer for that. There can be lots of guesses, none of which is good, but probably it would be easier for you just to check your configuration and you'll see right away. Check whether /tmp/mysql.sock and /tmp/mariadb.sock exist when you run with the default user, which one the server uses, which one mysqladmin uses, etc. If you can't figure it out, please let me know, I'll try to think of some diagnostics to investigate it.
            Hide
            rrajkomar Ryan RAJKOMAR added a comment -

            "I assume by "not returning prompt" you mean that the script keeps printing the dots" >> Yes that's exactly the issue I'm facing.
            "You changed the socket in the cnf file and put it in your basedir" >> I change the name of the socket file but did not move it (it is still in /tmp, only it's not mysql.sock but mariadb.sock)

            "So, while the server is running with /tmp/mariadb.sock, mysqladmin tries to ping it on /tmp/mysql.sock and never can. To fix it, you need to put the cnf file in one of default locations, e.g. /etc/mysql/my.cnf. " >> Why is there a difference in behaviour between mysql and mariadb here : I shouldn't have to change anything the process should the same way with both db servers, shouldn't it ?!

            "Now, regarding why it works for you in case of a default user, I don't have an answer for that. " >> Actually the user has nothing to do with it only the socket file : I tried with the mysql iser and a changed socket filename and it didn't work either.

            "Check whether /tmp/mysql.sock and /tmp/mariadb.sock exist when you run with the default user" >> Regardless of the name of the user or the name of the socket when starting the server, the socket file is created in the right location.

            "which one the server uses, which one mysqladmin uses, etc" >> How do I check that ?

            Thank you.

            Show
            rrajkomar Ryan RAJKOMAR added a comment - "I assume by "not returning prompt" you mean that the script keeps printing the dots" >> Yes that's exactly the issue I'm facing. "You changed the socket in the cnf file and put it in your basedir" >> I change the name of the socket file but did not move it (it is still in /tmp, only it's not mysql.sock but mariadb.sock) "So, while the server is running with /tmp/mariadb.sock, mysqladmin tries to ping it on /tmp/mysql.sock and never can. To fix it, you need to put the cnf file in one of default locations, e.g. /etc/mysql/my.cnf. " >> Why is there a difference in behaviour between mysql and mariadb here : I shouldn't have to change anything the process should the same way with both db servers, shouldn't it ?! "Now, regarding why it works for you in case of a default user, I don't have an answer for that. " >> Actually the user has nothing to do with it only the socket file : I tried with the mysql iser and a changed socket filename and it didn't work either. "Check whether /tmp/mysql.sock and /tmp/mariadb.sock exist when you run with the default user" >> Regardless of the name of the user or the name of the socket when starting the server, the socket file is created in the right location. "which one the server uses, which one mysqladmin uses, etc" >> How do I check that ? Thank you.
            Hide
            elenst Elena Stepanova added a comment -

            Ryan RAJKOMAR,

            I change the name of the socket file but did not move it

            I meant that you put the cnf file in the basedir.

            Actually the user has nothing to do with it only the socket file

            That's very good, then there is no mystery here at all.

            Why is there a difference in behaviour between mysql and mariadb here

            I'll check how MySQL behaves in this regard, and why there is a difference, if any. Which MySQL version did you try?

            Show
            elenst Elena Stepanova added a comment - Ryan RAJKOMAR , I change the name of the socket file but did not move it I meant that you put the cnf file in the basedir. Actually the user has nothing to do with it only the socket file That's very good, then there is no mystery here at all. Why is there a difference in behaviour between mysql and mariadb here I'll check how MySQL behaves in this regard, and why there is a difference, if any. Which MySQL version did you try?
            Hide
            rrajkomar Ryan RAJKOMAR added a comment -

            I meant that you put the cnf file in the basedir.

            Actually I put it in the datadir (I think, not in front of the right computer at the moment)

            Which MySQL version did you try?

            I was using a MySQL 5.6.* (21 I think, I'll have to check though)

            Show
            rrajkomar Ryan RAJKOMAR added a comment - I meant that you put the cnf file in the basedir. Actually I put it in the datadir (I think, not in front of the right computer at the moment) Which MySQL version did you try? I was using a MySQL 5.6.* (21 I think, I'll have to check though)

              People

              • Assignee:
                elenst Elena Stepanova
                Reporter:
                rrajkomar Ryan RAJKOMAR
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: