Postfix init.d script and populate chroot in multi-instance environment [debian bug #560682]

Bug #624522 reported by Nikos
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
postfix (Debian)
Fix Released
Unknown
postfix (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: postfix

Copy/paste from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560682

I hit the pb on Ubuntu Lucid :

===== description of the problem

  When running postfix daemon in chroot environment we need to assure
that the chroot dir is up-to-date (aka. etc/services lib/*, ...).

  For a single instance this is done by the /etc/init.d/postfix script.

  Starting with 2.6.x, Postfix supports now the multi-instance concept
(http://www.postfix.org/MULTI_INSTANCE_README.html). So for each
instance, we have a new /var/spool/postfix-instance that is created and
where daemons may be run as chrooted.

  The problem with the /etc/init.d/postfix script distributed by Debian
(in version 2.6.5-3) is that it does not take of the multi-instance
chroot dirs : the script only synchronizes the default instance (aka
/etc/postfix) and not all the other instances. So in a chroot
environment, with a chroot dir not synchronized we may have some
problems like "fatal: unknown service: smtp/tcp".

===== workaround

  I think the init.d script need to be adjust to take care of the
multi-instance chroot dir.

  Please see the attached patch
"postfix-init.d--multiinstance-chroot-aware.patch".

  It does 2 things :
    - iterate on each instance declared in the default one (postmulti
-l) and do the job that was done in the past
    - we have to synchronize some other file like "/dev/log" and
"/lib/libresolv*so*"

Tags: patch
Revision history for this message
Nikos (okin7) wrote :
Revision history for this message
Nikos (okin7) wrote :

Please note that one more file needs to be fixed :

/etc/resolvconf/update-libc.d/postfix

#!/bin/sh -e

# make sure we're still here...
[ -x /usr/sbin/postconf ] || exit 0

# iterate in each instance
for INSTANCE_CONF_DIR in `postmulti -l | tr -s " " " " | cut -d" " -f4`
do
    cp /etc/resolv.conf $(/usr/sbin/postconf -c $INSTANCE_CONF_DIR -h queue_directory)/etc/resolv.conf
done

/etc/init.d/postfix reload >/dev/null 2>&1 || exit 0

exit 0

tags: added: patch
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hello Nikos, thank you for the bug report and patch, the effort is much appreciated!

Linking directly to the Debian bug report.

Since this is filed upstream (debian) and has been acked there as well, marking as Triaged.

Setting Importance to Low, as this only impacts users running postfix in multi-instance chroot environments, which appears to be a new feature not supported previously.

Changed in postfix (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in postfix (Debian):
status: Unknown → New
Changed in postfix (Debian):
status: New → Fix Released
Revision history for this message
Jon Grimm (jgrimm) wrote :

Fix went into 2.6.5, precise has 2.9.1 so just going to mark this fixed release as fixed long ago.

Changed in postfix (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.