[Bug 257279] Re: -o Dpkg::Options::=--force-confdef ignored by cleanup run -- makes pkgsync hang

Daniel Hartwig 257279 at bugs.launchpad.net
Sat Mar 17 14:13:25 UTC 2012


Previous fix reverted.  It was somewhat of a hack and more work required
to accurately and *safely* invoke dpkg.

** Changed in: aptitude
       Status: Fix Committed => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to aptitude in Ubuntu.
https://bugs.launchpad.net/bugs/257279

Title:
  -o Dpkg::Options::=--force-confdef ignored by cleanup run -- makes
  pkgsync hang

Status in aptitude:
  Confirmed
Status in “aptitude” package in Ubuntu:
  Confirmed
Status in “synaptic” package in Ubuntu:
  New

Bug description:
  Binary package hint: aptitude

  When pkgsync is running, it calls aptitude with the options "-o
  Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold" to
  avoid being asked about what to do with changed conffiles. If such a
  prompt is displayed, aptitude will hang until killed, awaiting user
  input. pkgsync is typically run from cron, so asking for user input is
  a bad thing.

  In the normal case, aptitude propagates options down to dpkg like
  this:

    /bin/sh /etc/cron.daily/nightly-pkgsync
     \_ /bin/bash /usr/sbin/pkgsync
         \_ aptitude -y -q -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade afacli+ apache [...]
             \_ /usr/bin/dpkg --force-confdef --force-confold --status-fd 34 --configure [...]
                 \_ /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/sympa.postinst configure 
   
  However, if a package installation fails, this chunk of code in src/generic/apt/download_install_manager.cc is called:

     switch(pmres)
       {
       case pkgPackageManager::Failed:
         _error->DumpErrors();
         cerr << _("A package failed to install.  Trying to recover:") << endl;
         system("DPKG_NO_TSTP=1 dpkg --configure -a");
         _error->Discard();

  This results in the following call tree, which hangs as soon as a
  conffile is reached:

    /bin/sh /etc/cron.daily/nightly-pkgsync
     \_ /bin/bash /usr/sbin/pkgsync
         \_ aptitude -y -q -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade afacli+ apache [...]
             \_ sh -c DPKG_NO_TSTP=1 dpkg --configure -a
                 \_ dpkg --configure -a

  The rest of aptitude seems to use an pkgDPkgPM object from apt-
  pkg/deb/dpkgpm.h (from the apt source package) when interfacing with
  dpkg. I believe this cleanup code should adopt a similar approach.

  A workaround for this problem is to add these lines to /etc/dpkg/dpkg.cfg:
  force-confdef
  force-confold

To manage notifications about this bug go to:
https://bugs.launchpad.net/aptitude/+bug/257279/+subscriptions




More information about the foundations-bugs mailing list