[systemd-devel] Support for large applications

Lennart Poettering lennart at poettering.net
Fri Feb 19 15:31:00 UTC 2016


On Fri, 19.02.16 15:13, Tomasz Torcz (tomek at pipebreaker.pl) wrote:

> On Fri, Feb 19, 2016 at 12:49:53PM +0000, Zbigniew Jędrzejewski-Szmek wrote:
> > On Fri, Feb 19, 2016 at 01:42:12PM +0100, Michal Sekletar wrote:
> > > On Wed, Feb 17, 2016 at 1:35 PM, Avi Kivity <avi at scylladb.com> wrote:
> > > 
> > > > 3. watchdog during startup
> > > >
> > > > Sometimes we need to perform expensive operations during startup (log
> > > > replay, rebuild from network replica) before we can start serving. Rather
> > > > than configure a huge start timeout, I'd prefer to have the service report
> > > > progress to systemd so that it knows that startup is still in progress.
> > > >
> > > 
> > > Did you have a look at sd_notify (man 3 sd_notify)? Basically, you can
> > > easily patch your service to report status to systemd and tell to
> > > systemd exactly when it is ready to serve the clients. Thus you can
> > > avoid hacks like huge start timeout you've mentioned.
> > 
> > I don't think that helps, unless the service "lies" to systemd and
> > tells it has finished startup when it really hasn't (systemd would
> > ignore watchdog notifications during startup, and would do nothing if
> > they stopped coming, so the service has to tell systemd first that it
> > has started successfully, for the watchdog to be effective). Doing
> > that would fix this issue, but would have that systemd wouldn't know
> > that the service is still starting and would for example start
> > subsequent jobs.
> > 
> > I don't think there's a way around the issue short of allowing
> > watchdog during startup. Databases which do long recovery are a bit
> > special, most programs don't exhibit this kind of behaviour, but maybe
> > this case is important enough to add support for it.
> 
>   Maybe systemd could ignore watchdog notification during startup UNTIL
> first WATCHDOG=1 notification comes? Then normal watchdog logic would kick in.
>   This way we retain current logic (ignore watchdog during startup) unless
> application WANTS to tickle watchdog during startup.
>   Or is it too much magic?

Well, this means the time until this first WATCHDOG=1 is sent is
unprotected by the watchdog stuff. I am pretty sure this should be an
explicit configuration option, to close this gap.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list