[systemd-devel] mysqld about back to use mysqld_safe in Fedora

Honza Horak hhorak at redhat.com
Thu Jun 28 00:41:05 PDT 2012


On 06/27/2012 07:01 PM, Lennart Poettering wrote:
> Hmm, well, not really. "on-abort" means that systemd would only restart
> the service on actual crashes, i.e. where the main process exits with a
> signal like SIGSEGV, SIGBUS or SIGABRT. This is different from
> "on-failure" which is the behaviour you describe where we'd also restart
> the service if it exists with a non-zero exit code.
>
> I am pretty sure "on-abort" is actually what you really want here, no?
> The PID file checking sounds like a hack to achieve the same?

Not really, there are cases where mysqld notices fatal problems, gives 
up and crashes without a signal with exit-code 1. In this case we want 
still to restart it. On the other hand there are cases where mysqld 
cleans up and still returns 1. In this case we don't want to restart it 
(wrong configuration is one example). I don't see this as the best 
design, but changing it would be too painful. Since we'd like to 
preserve current/upstream's behavior, it seems better to let the whole 
auto-restarting thing to mysqld_safe script.

> An alternative, more modern way to handle all this is by simply using
> Type=notify and invoking sd_notify("READY=1"); in the daemon when
> everything is done. This should normally be a two line patch and makes
> PID files entirely redundant.

sd_notify seems to work fine, though a SELinux rule would have to be 
added. I'll prepare a patch and try to offer it to upstream, but as Tom 
said, we shouldn't expect much interest.

Honza


More information about the systemd-devel mailing list