On Thu, 28.06.12 09:41, Honza Horak (hho...@redhat.com) wrote: > > 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.
Hmm, so I#d guess it would actually really be worth fixing the return codes of MySQL. I mean, this is not really systemd-only thing. I'd expect that the Upstart folks and the SMF folks would be really interested in having reliable exit codes, too? > >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. Thanks! Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel