[systemd-devel] Support for large applications

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Feb 19 14:38:45 UTC 2016


On Fri, Feb 19, 2016 at 03:13:43PM +0100, Tomasz Torcz 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?

I like it.

Zbyszek


More information about the systemd-devel mailing list