[systemd-devel] mysqld about back to use mysqld_safe in Fedora
Honza Horak
hhorak at redhat.com
Wed Jun 27 05:50:21 PDT 2012
Hi guys,
we've met some problems around mysqld and systemd's auto-restart feature
recently in Fedora, which has been fortunately fixed by Michal few days
ago [1]. However, there are still some doubts, which convince us to go
back and use mysqld_safe script for monitoring and restarting potential
crashed main process, instead of let it be done by systemd.
One of the issue is (in)ability to imitate the original behavior of
mysqld_safe, which restarts the main process only if it crashes and the
pid file isn't properly cleaned up. There's probably not a way how to do
something like that in systemd, is it? AFAIK we can only use option
on-abort, but we'd have to be sure that exit code is never 0 in cases we
want the daemon to be restarted.
Another issue is the PID file guessing. It usually works fine, but if we
want to be sure what pid is monitored, we should use PIDFile= option.
However, when we use this we don't know when the pidfile is created,
while waiting some sane time is not a nice solution and could bring
another issues. Using notify feature doesn't helps us, since we used
Type=forking.
Another problem is, that since the main process pid is known too late,
we cannot use it in mysqld-wait-ready, which is a script run in
ExecStartPost to check if mysqld daemon is ready to accept connections.
There have been another thoughts like socket activation when we were
working on mysqld unit file a year ago, but this feature seemed to be
more problematic than helpful. Feel free to go through the discussion to
read more at [2].
As written above, we're about to use mysqld_safe to do all the stuff
around monitoring the main process and changing service to Type=simple
again. Maybe you're asking why I'm telling you. Well, take it as a
feedback, what issues we currently have during mysqld packaging. And off
course, if you have any thoughts that can help, we'll be happy to hear that.
[1]
http://cgit.freedesktop.org/systemd/systemd/commit/?id=0c7f15b3a95c3596a4756de5c44eb1fdcd0034fc
[2] https://bugzilla.redhat.com/show_bug.cgi?id=714426
Cheers,
Honza
More information about the systemd-devel
mailing list