[Bug 901038] Re: packages fail to install: Failed to connect to socket /com/ubuntu/upstart: Connection refused

James Hunt 901038 at bugs.launchpad.net
Tue Oct 22 15:52:33 UTC 2013


I believe the problem here is that although upgrading the Upstart
package itself and any of its dependent library packages will force a
stateful re-exec, that operation severs all D-Bus connections (since
D-Bus does not provide a way to serialise objects such as
DBusConnection) and crucially that operation is async...

= Scenario causing this Bug =

I think the behaviour these bugs are caused by is something like:

1) dpkg upgrades Upstart (or one of its dependent libraries).
2) The relevant postinst maintainer script requests Upstart re-exec itself.
3) The re-exec starts (asynchronously).
4) dpkg moves on to installing/upgrading other packages.
5) invoke-rc.d, called from a maintainer script from another package decides it needs to call start(8) or initctl(8) for example.
6) The appropriate command is run (start/initctl), but fails since Upstart is still finishing re-exec'ing itself.

= Thoughts =

== Tweak invoke-rc.d ==

One possible fix would be to modify invoke-rc.d so that before
attempting to run start etc, it first checks that Upstart is contactable
by waiting for a "reasonable amount of time" for Upstart to respond
(assuming it could be in the process of being re-exec'ed). However, that
could be unreliable unless that check occurred before *every* call to
initctl/start/stop/restart/reload-configuration. This is achievable but
would clutter the code a little.

== Create a dpkg Upstart trigger ==

Another option might be to create a dpkg trigger to handle restarting
upstart and have that trigger call 'telinit u' *and then wait* again for
that "reasonable amount of time" until Upstart responds before the
trigger ends. This sounds attractive since the logic for restarting and
waiting is contained in one location. However, if my understanding of
triggers is correct (?) this would actually cause another problem: since
Upstart grew the ability to re-exec, the expected behaviour is that "as
soon as Upstart has been upgraded, the running version of Upstart will
match the installed version of Upstart". Using a trigger would break
this understanding since the Upstart restart would only occur *after*
all the other packages (that declare an interest in the upstart trigger)
have been updated.

== Modify initctl ==

A third option could be to modify initctl to make it retry on failure to
connect. This could in fact be the default since on a normally working
system, there would be no behaviour change. Then, when invoke-rc.d calls
initctl/start/etc, it should DTRT under all scenarios.

= Plan =

Short term, tweaking invoke-rc.d is probably the most pragmatic (albeit
potentially racy) solution. Long term, we should modify initctl.

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

Title:
  packages fail to install: Failed to connect to socket
  /com/ubuntu/upstart: Connection refused

Status in “upstart” package in Ubuntu:
  Confirmed

Bug description:
  This is a second install of Xubuntu 12.04-testing.

  Apport seems to think this is not reported.  Reported it on my other
  install.

  Do not have time or desire to hunt up the other bug, you may have
  deleted it for all I know.

  ProblemType: Package
  DistroRelease: Ubuntu 12.04
  Package: cups (not installed)
  ProcVersionSignature: Ubuntu 3.2.0-3.8-generic 3.2.0-rc4
  Uname: Linux 3.2.0-3-generic x86_64
  NonfreeKernelModules: fglrx
  ApportVersion: 1.90-0ubuntu1
  Architecture: amd64
  Date: Fri Dec  2 20:01:35 2011
  Df:
   Filesystem     1K-blocks    Used Available Use% Mounted on
   /dev/sda9       10304824 5614180   4167176  58% /
   udev             1536476       0   1536476   0% /dev
  DuplicateSignature:
   Setting up rsyslog (5.8.6-1ubuntu2) ...
   start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
   invoke-rc.d: initscript rsyslog, action "restart" failed.
   dpkg: error processing rsyslog (--configure):
    subprocess installed post-installation script returned error exit status 1
  ErrorMessage: subprocess installed post-installation script returned error exit status 1
  InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110921.3)
  SourcePackage: cups
  Title: package cups (not installed) failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/901038/+subscriptions



More information about the foundations-bugs mailing list