[MDEV-5713] RFE: Add support for systemd notify feature Created: 2014-02-21 Updated: 2015-10-15 Resolved: 2015-10-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Packaging |
| Fix Version/s: | 10.1.8 |
| Type: | Task | Priority: | Major |
| Reporter: | Honza Horak | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | systemd | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Sprint: | 10.1.7-1, 10.1.7-2, 10.1.8-1, 10.1.8-3, 10.1.8-4 | ||||||||||||||||||||||||
| Description |
|
Originally reported as http://bugs.mysql.com/bug.php?id=65809 Since systemd tries to start services parallel, it's not easy to ensure that mysql daemon is started before another service, which requires it. Currently, we have to use an arbitrary script, that checks if the daemon is ready. However, systemd has a feature to notify daemon about a service status, which would help in this scenario a lot and packagers wouldn't need any additional scripts to test daemon status. MySQL daemon can simple send a message to systemd daemon, that startup actions have been done successfully and we are ready to accept connections. Using this feature is really straightforward and doesn't make any issues if a user uses alternative init system. To be concrete, only one function call and some configuration checking is needed. Please, consider adopting the following patch attached. |
| Comments |
| Comment by Sergei Golubchik [ 2014-02-21 ] |
|
hhorak, see also |
| Comment by Honza Horak [ 2014-02-21 ] |
|
Well, simply said from my POV, it would mean a lot of work more needed to be done. IIUIC, it might help if we either: 1) stopped using mysqld_safe and ran mysqld directly in the systemd unit file (then using "type=forking" systemd would wait until the first process exists, which would be at a time the forked process would be already prepared; however, we'd lose some functionality in mysqld_safe) 2) added the notification mechanism into mysqld_safe, so mysqld_safe would send message as soon as the mysqld's first process finishes. Then we'd have to add a logic for monitoring the forked process, which is actually what systemd does, so we would basically duplicate the effort. 3) changed "eval" call to "exec" call in mysqld_safe, so we could use the parameter parsing done by mysqld_safe, but monitoring itself would be done by systemd. Getting rid of mysqld_safe monitoring (options 1 and 3) would mean that we'd have to use restarting mechanism from systemd to recover after daemon failure, which is not so easy now – we simply cannot distinguish easily between daemon failure and desired stop (systemd decides based on exit codes, which would mean changing the exit codes and use them properly on many places). |
| Comment by Brian Evans [ 2014-10-13 ] |
|
Suggest a cmake option be added (default on if you want), so that this can be decided at build time. |
| Comment by Daniel Black [ 2014-12-27 ] |
|
As requested by grknight added a WITH_SYSTEMD option here. Added packages deps to the debian/ubuntu. Added bits to the support-files/mysql.spec for systemd however its not packaged until openSUSE_13 and RHEL7 ( |
| Comment by Daniel Black [ 2015-01-02 ] |
|
patchwork continuing on |
| Comment by Daniel Black [ 2015-01-02 ] |
|
needed: locations in the code for global server status and presenting notification to users some STATUS= messages when in innodb recovery. Any other cases? |
| Comment by Daniel Black [ 2015-03-11 ] |