[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Seamless restarts

> -----Original Message-----
> From: Hallvard B Furuseth [mailto:h.b.furuseth@usit.uio.no]

> > I'm sure we already agreed on this - it would be safe to
> unconditionally
> > fork() a surrogate parent at slapd startup.
> Hold on - we can just as well fork() the "restarted" slapd
> process early.
> It can sit and wait for the parent slapd to die or to decide to do a
> seamless restart.  If the latter, it starts up and takes over.

Yes, exactly. That's why I talked about doing the fork() after the listener
sockets are established. It can sit and wait for back-shell requests, or a
restart request.

> If the child is forked before chdir/chroot, we won't have any problems
> with the slapd.args file and exec path having a different name either.


> For that matter, we might not even need to exec() slapd again, but
> personally I'd prefer to do that anyway, in case the restart is done
> because the slapd executable has been replaced with a newer version.

Right. The exec() is definitely necessary for upgrade purposes.
> > The question then is, will the C library spawn any threads
> behind our
> > back, while we're resolving DNS names and creating listener sockets?
> Not before we have started threading, surely?

Hopefully not...

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support