Fails to launch recovery menu when (at least) Postfix installed

Bug #927803 reported by Jani Uusitalo
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
friendly-recovery (Ubuntu)
Triaged
Medium
Unassigned
postfix (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I have two computers affected by this and one that is not, each running Precise. I've tracked down the cause, but I'm not sure which of the components involved (friendly-recovery, resolvconf, postfix and upstart) is the culprit, so I'll file this for friendly-recovery which is at least severly affected. Feel free to correct the target with better insight.

Steps to reproduce:
0. Have the 'postfix' and 'resolvconf' packages installed.
1. Boot into recovery mode.

What happens:
The boot proceeds in nonsplash (text) mode, but in the end the recovery menu fails to show up. Instead the graphical greeter is brought up.

What I expect to happen:
For the recovery menu to show up so I can use it.

The cause:
For debugging this, I first enabled logging for friendly-recovery.conf. That log implicated resolvconf, so I enabled logging for resolvconf, and that in turn revealed this:

cp: cannot create regular file `/var/spool/postfix/etc/resolv.conf': Read-only file system

So I checked, and indeed postfix wasn't there on my laptop which wasn't affected. It seems that due to the read-only file system, the resolvconf upstart job fails, which in turn leads to the resolvconf-dependent friendly-recovery job to also fail.

The workaround:
Uninstall postfix if you can afford to.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: friendly-recovery 0.2.19
ProcVersionSignature: Ubuntu 3.2.0-14.23-generic 3.2.3
Uname: Linux 3.2.0-14-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
CheckboxSubmission: 09ae689090491ca53449589269e4bfd8
CheckboxSystem: edda5d4f616ca792bf437989cb597002
Date: Mon Feb 6 20:36:29 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
PackageArchitecture: all
SourcePackage: friendly-recovery
UpgradeStatus: Upgraded to precise on 2012-01-17 (20 days ago)
mtime.conffile..etc.init.friendly.recovery.conf: 2012-02-06T20:17:28.034920

Revision history for this message
Jani Uusitalo (uusijani) wrote :
Revision history for this message
Jani Uusitalo (uusijani) wrote :
Revision history for this message
Jani Uusitalo (uusijani) wrote :
Revision history for this message
Jani Uusitalo (uusijani) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

I think this is a bug in both postfix and friendly-recovery.

- resolvconf will always be run in early boot, to ensure that /etc/resolv.conf is available ASAP - *before* the root filesystem is mounted read-write. Any resolvconf hooks, such as /etc/resolvconf/update-libc.d/postfix, *must* account for this and not exit non-zero if the filesystem is not yet writable. (The hook can and should be a no-op at this point in the boot, because the postfix init script which runs later will do its own copy of /etc/resolv.conf into the chroot.)

- friendly-recovery should not care about the exit status of the initctl emit command. It should still wait for all dependent events to trigger in order to not race, but it should not care if one of the dependent jobs has failed.

So this is a medium-severity bug in friendly-recovery, and a high-severity bug in postfix.

Changed in friendly-recovery (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in postfix (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Steve Langasek (vorlon) wrote :

Thomas, is there any chance that you have postfix installed in the environment where you're seeing the resolvconf job fail at boot? If so, this postfix resolvconf hook script probably explains what you're seeing. (And if you don't have postfix installed, it could be a different hook script causing a similar problem.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postfix - 2.8.7-1ubuntu1

---------------
postfix (2.8.7-1ubuntu1) precise; urgency=low

  * debian/update-libc.d: before we try to copy the resolv.conf over, just
    check if the service is running by calling /etc/init.d/postfix status.
    If it's not running, there's never a need to copy, and if it's running
    we know the package is installed - making other checks superfluous and
    ensuring our hook doesn't exit non-zero if called before /var is mounted
    read-write. LP: #927803.
 -- Steve Langasek <email address hidden> Thu, 16 Feb 2012 17:53:51 -0800

Changed in postfix (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Thomas Hood (jdthood) wrote :

> Thomas, is there any chance that you have postfix installed
> in the environment where you're seeing the resolvconf job
> fail at boot?

Yes, postfix was installed and was causing the resolvconf job to fail at boot. See https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/933566/comments/6.

Revision history for this message
Thomas Hood (jdthood) wrote :

I installed postfix 2.8.7-1ubuntu1. It still causes the resolvconf job to fail at boot.

    $ status resolvconf
    resolvconf stop/waiting
    $ dpkg -l postfix|grep ^ii
    ii postfix 2.8.7-1ubuntu1 High-performance mail transport agent

/var/log/upstart/resolvconf.log:
    cp: cannot create regular file `/var/spool/postfix/etc/resolv.conf': Read-only file system
    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

Revision history for this message
Steve Langasek (vorlon) wrote :

Not quite fixed then, but I've reproduced this and see what's going wrong.

Changed in postfix (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postfix - 2.8.7-1ubuntu2

---------------
postfix (2.8.7-1ubuntu2) precise; urgency=low

  * debian/init.d: if postmulti fails (which for some reason it does when
    the rootfs is read-only in early boot!), the init script 'status'
    command returns zero because "all" of 0 configured instances are
    running. Fix the script to return non-zero in this case. LP: #927803.
 -- Steve Langasek <email address hidden> Fri, 17 Feb 2012 11:07:48 -0800

Changed in postfix (Ubuntu):
status: In Progress → 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.