[MDEV-8593] mysqld_safe start does not give back prompt on succes when running with --user option Created: 2015-08-09 Updated: 2019-04-06 Resolved: 2019-04-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.0.21 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Ryan RAJKOMAR | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| 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. |
| Comments |
| Comment by Ryan RAJKOMAR [ 2015-08-10 ] | ||
|
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. | ||
| Comment by Ryan RAJKOMAR [ 2015-08-10 ] | ||
|
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. | ||
| Comment by Elena Stepanova [ 2015-08-11 ] | ||
|
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. | ||
| Comment by Ryan RAJKOMAR [ 2015-08-11 ] | ||
|
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} startPrior 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. | ||
| Comment by Elena Stepanova [ 2015-08-12 ] | ||
|
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
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. 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. | ||
| Comment by Ryan RAJKOMAR [ 2015-08-13 ] | ||
|
"I assume by "not returning prompt" you mean that the script keeps printing the dots" >> Yes that's exactly the issue I'm facing. "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. | ||
| Comment by Elena Stepanova [ 2015-08-13 ] | ||
I meant that you put the cnf file in the basedir.
That's very good, then there is no mystery here at all.
I'll check how MySQL behaves in this regard, and why there is a difference, if any. Which MySQL version did you try? | ||
| Comment by Ryan RAJKOMAR [ 2015-08-13 ] | ||
Actually I put it in the datadir (I think, not in front of the right computer at the moment)
I was using a MySQL 5.6.* (21 I think, I'll have to check though) | ||
| Comment by Elena Stepanova [ 2019-04-06 ] | ||
|
It appears that the only question which remained here and the reason why we kept it open was why MySQL behaves differently. I don't think it's worth digging into, the reason of the problem itself was quite straightforward – mismatching socket files for the server and the client. |