[MDEV-7694] MariaDB - mysqld cannot start when restarting from systemd Created: 2015-03-10 Updated: 2016-02-12 Resolved: 2015-07-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.0.16 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Nirbhay Choubey (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | SUSE, systemd | ||
| Environment: |
SLES-12, x86_64 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
MariaDB - mysqld cannot start when restarting from systemd
== mysqld.log ==
Workaround: - use stop and start
Note: https://bugzilla.suse.com/show_bug.cgi?id=921115 |
| Comments |
| Comment by Daniel Black [ 2015-03-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
https://github.com/MariaDB/server/pull/26 changes the service definition to avoid pid files probably needs galera related socket activation for the galera ports. I'm tempted to wait until the first part is merged. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-03-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The error log related to the restart failure is missing (the quoted fragment precedes it, timestamps don't much). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
nirbhay_c, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
elenst You mean the entire log? with complete sequence? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
nirbhay_c,
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Viktor Kijasev [ 2015-03-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Full log | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-04-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So, the log confirms that mysqld was actually started all right, it's the script that fails to recognize it and produces the error. Is it still happening? If it is, can you run ps -ef | grep mysqld after the failed attempt to restart the service, and do it a couple times with a few seconds interval? Thanks. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Viktor Kijasev [ 2015-04-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Elena,
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Viktor Kijasev [ 2015-04-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also I was suspicious before, it can be related to setting up ssl connection - like creating new ssl user, generating certificates, opening session as ssl user etc. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-04-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So, there is nothing wrong with the actual server startup, mysqld_safe starts once, survives, and starts mysqld which also survives. The whole problem is simply the service script not being able to chmod on the pid file, apparently because the pid file doesn't get created in time. I don't know if it can be related to SSL – I suppose hypothetically it's possible if some SSL-related activity happens upon startup before creating the pid file, thus delaying it a little bit. I didn't check it though. Daniel's changes look rather invasive, I don't know if they'll make it to the 10.0 which is well post-GA. On the other hand, this particular problem can probably have a simple workaround. Currently chmod on the pid file is the very last thing the service script does, then it exits with the status of the operation. While with the socket file there is a wait, and even after the wait its absence is not considered an error, with the pid file it's much simpler – a single attempt to chmod and then exit. I suppose adding at least a timed wait on the pid file should highly reduce the probability of the failure, if not eliminate it completely. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-04-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Predominately in the socket activation mode of systemd. Removing 'Requires=%p.socket' from the mariadb.service would make this run in the Type=Notify mode which also bypasses the pid file/mysqld_safe issues and all of the socket activation code (https://github.com/MariaDB/server/pull/26/files#diff-e7d51f293adc9257284fbdec858056dfR6149 because sd_listen_fds() return 0). The storage engine notify commands could also be removed from 10.0 if this is too much.
init_ssl is called in mysqd just before the bit that creates the pid. While it initializes a few variables and reads the ssl server side key/certs it doesn't seem to be that intensive.
Looks like it too me too. And why is it doing a chmod on a pid file anyway? No idea. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2015-07-25 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As far as I understand, it's not a MariaDB bug, both mysqld and mysqld_safe work correctly. This is an issue with the systemd service script, but we do not have systemd service script (yet). You're having a problem with a third-party systemd service script, we cannot fix it. But there is |