Mark Smith smitty at
Wed Oct 10 14:06:09 UTC 2007

> Will Perlbal unbind from it's listening ports immediately upon getting
> the 'shutdown graceful' command? If not, then would I need to somehow
> monitor the old instance once I issue the command and then startup a new
> Perlbal once the old one is completely finished?
> If I were to write a Perlbal psuedo-init script, would the following
> logic work?
> - get Perlbal PID (from file?)
> - connect to running Perlbal via telnet
> - issue 'shutdown graceful' command
> - wait until telnet socket is closed (indicating Perlbal has terminated)
> - double check that Perlbal PID is no more (i.e. kill -0 $PID)
> - start a new Perlbal
> - connect to new Perlbal via telnet to confirm it's running

This is the flow I used on LJ:

* connect to existing Perlbal management port
* issue 'shutdown graceful'
* start new Perlbal up immediately
* wait 10 seconds (usually I'd check the new Perlbal to make sure it's
getting traffic here)
* if the socket from the first step is still open, issue 'shutdown' command

If the socket goes away, then Perlbal shut itself down all of the way.  If
not, then the final 'shutdown' forces an immediate termination.  You can do
the work with the pid to ensure it's gone away if you want, that'd certainly
be safer.

But yes, Perlbal immediately unbinds all listening sockets when you issue a
graceful shutdown command.

As an aside, Perlbal should have a 'shutdown graceful [timeout]' option
where you can specify how many seconds to sit around for, then force a hard
exit.  Hmm...

Mark Smith / xb95
smitty at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the perlbal mailing list