resolvconf update script should not produce error when main.cfg missing

Bug #530323 reported by Simon Huerlimann
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Fix Released
Medium
LaMont Jones

Bug Description

Binary package hint: postfix

I'm using a 9.10 server installation. The following happens as postfix got installed as an indirect dependency of ubuntu-vm-builder. resolvconf has been installed manually.

When running ifup/ifdown the following errors are shown:

 /usr/sbin/postconf: fatal: open /etc/postfix/main.cf: No such file or directory
 cp: `/etc/resolv.conf' and `/etc/resolv.conf' are the same file
 run-parts: /etc/resolvconf/update-libc.d/postfix exited with return code 1
 run-parts: /etc/resolvconf/update.d/libc exited with return code 1
 run-parts: /etc/network/if-down.d/resolvconf exited with return code 1

It is correct, that no /etc/postfix/main.cf exists, but this is an irrelevant information when doing network interface maintenance. I thus propose to simply enhance the the check in /etc/resolvconf/update-libc.d/postfix from

 [ -x /usr/sbin/postconf ] || exit 0

to

 [ -x /usr/sbin/postconf -a -e /etc/postfix/main.cf] || exit 0

Even better would be to also detect major postfix configuration problems by testing '/usr/sbin/postconf -h queue_directory' for empty result.

Related branches

LaMont Jones (lamont)
Changed in postfix (Ubuntu):
assignee: nobody → LaMont Jones (lamont)
Thierry Carrez (ttx)
Changed in postfix (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
stlubuntu (jlrbennett) wrote :

I am running 64-bit Ubuntu 10.04 Desktop (in place upgrade from 09.10) on an 3.0 Ghz AMD Phenom II 945 Quad Core / 6 GB RAM, Network-Manager was not present prior to or after upgrading (intentionally). Networking is handled by a traditional interfaces file. Sometimes immediately following boot up, there is (at least temporarily) no dns name resolution and consequently no internet access until a sudo /etc/init.d/networking restart is performed, the output of which is as follows:

user@host:~$ sudo /etc/init.d/networking restart
[sudo] password for user:
 * Reconfiguring network interfaces... There is already a pid file /var/run/dhclient.eth0.pid with pid 2324
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:24:8c:7e:ce:78
Sending on LPF/eth0/00:24:8c:7e:ce:78
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.254 port 67
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:24:8c:7e:ce:78
Sending on LPF/eth0/00:24:8c:7e:ce:78
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPOFFER of nn.nnn.nnn.nn from 192.168.1.254
DHCPREQUEST of nn.nnn.nnn.nn on eth0 to 255.255.255.255 port 67
DHCPACK of nn.nnn.nnn.nn from nn.nnn.nnn.nn
/usr/sbin/postconf: fatal: open /etc/postfix/main.cf: No such file or directory
cp: `/etc/resolv.conf' and `/etc/resolv.conf' are the same file
run-parts: /etc/resolvconf/update-libc.d/postfix exited with return code 1
run-parts: /etc/resolvconf/update.d/libc exited with return code 1
bound to nn.nnn.nnn.nn -- renewal in 238 seconds.
ssh stop/waiting
ssh start/running, process 3119
ssh stop/waiting
ssh start/running, process 3177
                                                                         [ OK ]
user@host:~$

Also, FWIW, I believe that dnsmasq and dhcp3-server are running

Revision history for this message
Andriy Tymchenko (silpol) wrote :

it affects me on desktop version too

user@hostname:~$ lsb_release -drc
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic

LaMont Jones (lamont)
Changed in postfix (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

postfix (2.8.4-1ubuntu1) oneiric; urgency=low

  * Add back in apport. Debian lacks it, so the package is now
    forked. :(

 -- LaMont Jones <email address hidden> Sat, 20 Aug 2011 14:39:33 -0600

postfix (2.8.4-1) unstable; urgency=low

  [Scott Kitterman]

  * Switch to debhelper 7, use dh_prep instead of dh_clean -k

  [Friedemann Stoyan]

  * create chroots with the right ca_path. Closes: #627266

  [Wietse Venema]

  * Upstream fix release
    - Performance: a high load of DSN success notification requests
      could slow down the queue manager.
    - Bugfix (introduced Postfix 2.3 and Postfix 2.7): the Milter
      client reported some "file too large" errors as temporary
      errors.
    - Bugfix (introduced in Postfix 1.1, duplicated in Postfix
      2.3, unrelated mistake in Postfix 2.7): the local(8) delivery
      agent ignored table lookup errors in mailbox_command_maps,
      mailbox_transport_maps, fallback_transport_maps and (while
      bouncing mail to alias) alias owner lookup.
    - Bugfix (introduced Postfix 2.6 with master_service_disable)
      loop control error when parsing a malformed master.cf file.
    - Bugfix (introduced: Postfix 2.7): "sendmail -t" reported
      "protocol error" after queue file write error.
    - Linux kernel version 3 support.
    - Workaround: some Spamhaus RHSBL rejects lookups with "No
      IP queries" even if the name has an alphanumerical prefix.
      We play safe, and skip both RHSBL and RHSWL queries for
      names ending in a numerical suffix.

  [LaMont Jones]

  * apport, fix FTBFS on linux 3.0 - From ubuntu.
  * SASL vs multiarch. Closes: #638443, #638045
  * Update init.d script to handle multi_instance setups. Closes: #560682
  * Do not try to update resolv.conf when main.cf does not exist. LP: #530323
  * Better handle bad map names in postmap -u. LP: #647647
  * Drop apport usage, since debian lacks it and failing to build is bad.

 -- LaMont Jones <email address hidden> Sat, 20 Aug 2011 13:48:59 -0600

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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