So there's this blog post circling around, claiming full native systemd s...
So there's this blog post circling around, claiming full native systemd suport in MySQL. It's quite a stretch and not really true.
It boils down to MySQL shipping mysqld.service unit. It invokes database as Type=forking and does not even scratch systemd support.
At the minimum, MySQL should implement Type=notify behaviour. It would give perfect, 100% correct readiness notification. It would open a door to utilizing the watchdog, which is important for people caring about reliability. It would make sysadmins happier by providing extended status messages.
Above the minimum level would be to support for socket-activation. This is often asked by various people. It would bring fully implicit dependencies, make the database always available and allow for restarts without dropping any client connections.
The team behind the blogpost writes: ”It would be great if systemd provides some sort of generic readiness protocol without linking to their library”. Uhm, hello? Systemd's protocol is extremally simple: get a socket location from an environment variable, open it and write a text string. You can't go more simple and generic than that! The protocol is fully described in ”man sd_notify”.
There's no need to link to systemd libraries if you don't want to. The protocol can be implemented in few lines of code in any given language. libsystemd is a great example how to do it – few concise lines of basic C.
Even if you don't like LGPL-2.1+ license, you can grab liberally, MIT-licensed earlier version from systemd git.
To sum up, what's in MysSQL 5.7.6 is not a native systemd support.
Update 2015-08-11: MariaDB developers got systemd support right – https://github.com/MariaDB/server/pull/83 (thanks +Clement Wong for spotting.)
It boils down to MySQL shipping mysqld.service unit. It invokes database as Type=forking and does not even scratch systemd support.
At the minimum, MySQL should implement Type=notify behaviour. It would give perfect, 100% correct readiness notification. It would open a door to utilizing the watchdog, which is important for people caring about reliability. It would make sysadmins happier by providing extended status messages.
Above the minimum level would be to support for socket-activation. This is often asked by various people. It would bring fully implicit dependencies, make the database always available and allow for restarts without dropping any client connections.
The team behind the blogpost writes: ”It would be great if systemd provides some sort of generic readiness protocol without linking to their library”. Uhm, hello? Systemd's protocol is extremally simple: get a socket location from an environment variable, open it and write a text string. You can't go more simple and generic than that! The protocol is fully described in ”man sd_notify”.
There's no need to link to systemd libraries if you don't want to. The protocol can be implemented in few lines of code in any given language. libsystemd is a great example how to do it – few concise lines of basic C.
Even if you don't like LGPL-2.1+ license, you can grab liberally, MIT-licensed earlier version from systemd git.
To sum up, what's in MysSQL 5.7.6 is not a native systemd support.
Update 2015-08-11: MariaDB developers got systemd support right – https://github.com/MariaDB/server/pull/83 (thanks +Clement Wong for spotting.)
MySQL 5.7 -- Native Systemd Support
+1'd by: Bernhard Friedreich (friesoft), Maciej Pietrzak, Gergely Pász (Pas), Conrad Meyer, Marcin “hrw” Juszkiewicz, Massimiliano Torromeo, Harald Hoyer, Wiktor Julian Sztwiertnia (Druedain), Andrew McCullough, Cristian Ciupitu, Jan Engelhardt, Thomas Andersen, Jóhann B. Guðmundsson, Peter Sztan, Colin Guthrie, Lennart Poettering, Zbyszek Jedrzejewski-Szmek
Reshared by: Markus Lauer, digi owl, Conrad Meyer, Kai Bojens, Thomas Brandtstaetter, Kristian Köhntopp, Lennart Poettering
Comments
Comments powered by Disqus
They also have a separate binary to pre-create directories and mysql cannot read its configuration from a config file, so environment variables have to be used.
But all in all, it doesn't look too bad. At least it doesn't do anything harmful.
https://gist.github.com/eliasp/370ca2b60c3371d1d275
I couldn't tell from the unit file that it tries to write persistent data /tmp... But I would still say that it's not harmful (to others). It simply does not work.
Quoting the MySQL guys here directly:
[…] Replication and other parts of server saves file in /tmp and we don't those files to be removed during mysql restart or server reboot. […]
Nothing to add, I'd say :)