Harakiri:
> I have a tcp table and policy service - when i shut these down, i
> close each open session and unbind the listener port - for some
> reason postfix does not close its client connection to them for
> about 60sec.

Yes. Creating a connection for each query is wasteful, especially
if your process exits after the connection is closed.

You can look at "postconf | grep '= 60'" output and reduce
the time limit, but that will also cost you in performance.

Or you implement Postfix's "fast" restart code.

- Set the SO_REUSEADDR socket option on the listen socket. Code
  from Postfix:

    int     on = 1;

    if ((sock = socket(res->ai_family, res->ai_socktype, 0)) < 0)
        ...error...
    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
                   (char *) &on, sizeof(on)) < 0)
        ...error...
    if (bind(sock, res->ai_addr, res->ai_addrlen) < 0) {
        ...error...

- Run your server processes in a separate process group. I use
  setsid() for this.

- "kill" your existing server processes. For example "kill -9
  -process-group-id". The '-' before the process group ID kills the
  process group instead of a process.

- Start a new server process.

        Wietse

Reply via email to