Comment 5 for bug 151850

Revision history for this message
Matt LaPlante (cybrmatt) wrote :

There are a couple other issues with the init script that will case it to fail with postfix chroot:

- It doesnt give the postfix user any write permissions to the socket (which is dynamically created/destroyed).
- There's a race condition where it doesn't wait for the socket file to be created, so the chgrp command actually fails silently.

I've made the following modifications which, although not particularly dynamic, make it work properly on my setup:

  while [ ! -e "$SOCKET_PATH" ]; do
    sleep 2
  done

  if [ $ret = 0 ] && [ -e "$SOCKET_PATH" ] && [ "$USE_POSTFIX" = 'yes' ]; then
    chgrp postfix $SOCKET_PATH
    chmod g+w $SOCKET_PATH
  fi