runit cannot be installed (Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused)

Bug #1448164 reported by Jeff
This bug affects 290 people
Affects Status Importance Assigned to Milestone
xpl-perl
New
Undecided
Unassigned
runit (Ubuntu)
Fix Released
Medium
Pranjal Bharti
Xenial
Triaged
High
Dimitri John Ledkov

Bug Description

In Ubuntu 15.04 "runit" cannot be installed. postinst fails with the following message:

start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

Due to this error, packages depending on runit, like git-daemon-run, cannot be installed as well.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in runit (Ubuntu):
status: New → Confirmed
Revision history for this message
Jacob Gadikian (faddat) wrote :

Same as @jeff.

Was installing some git-ish stuff and all the sudden, kablooey.

start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

Revision history for this message
Ryan (rpholloman) wrote :

Same as Jeff and Faddat. Can't finish installing git-all because this bug is blocking. Please let me know if there is a workaround before bug resolution.

Revision history for this message
Marc Culler (marc-culler) wrote :

The problem here is that the runit package assumes that the system is using upstart; it does not work with systemd, which became the default as of 15.04. Another package besides git-all which is affected by this is qmail-run.

A workaround is to switch your 15.04 system back to using upstart. This can be done by installing the upstart-sysv package. See https://wiki.ubuntu.com/SystemdForUpstartUsers .

Hopefully by the time 15.10 appears the packages which implicitly depend on having upstart running will have been adjusted to work with systemd, and you can switch back to systemd by installing systemd-sysv and ubuntu-standard.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Currently also affects runit 2.1.2-3ubuntu1 on Ubuntu Wily.

summary: - runit cannot be installed
+ runit cannot be installed (Unable to connect to Upstart: Failed to
+ connect to socket /com/ubuntu/upstart: Connection refused)
tags: added: vivid wily
Changed in runit (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
no longer affects: hundredpapercuts
Revision history for this message
Jeff (ujr-n) wrote :

Still the same with released 15.10.

I think this is critical, because it breaks other packages.

It's quite clear that this bug comes from runit not working with systemd, and I don't know what can be done to make it cooperate (or if this is possible at all) - but how could it be released in the first place in such condition if systemd is the default?

Going back to upstart is not really an option. I imagine it will break more things than it will do good.

Revision history for this message
Florian Lunzer (florianlunzer) wrote :

Was installing git-all, and know i have the same issue.

I need it for letsencrypt. It is very important to make the www-web safer.

Have anyone a reason?

This is a part from the command line output (But the text output is partly in German....so German Users can easily find this page)

sudo apt-get install git-all

runit (2.1.2-3ubuntu1) wird eingerichtet ...
start: Verbindung zu Upstart nicht möglich: Failed to connect to socket /com/ubuntu/upstart: Verbindungsaufbau abgelehnt
dpkg: Fehler beim Bearbeiten des Paketes runit (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von git-daemon-run:
 git-daemon-run hängt ab von runit; aber:
  Paket runit ist noch nicht konfiguriert.

dpkg: Fehler beim Bearbeiten des Paketes git-daemon-run (--configure):
 Abhängigkeitsprobleme - verbleibt unkonfiguriert
tla-doc (1.3.5+dfsg1-1) wird eingerichtet ...
Es wurde kein Apport-Bericht verfasst, da die Fehlermeldung darauf hindeutet, dass dies lediglich ein Folgefehler eines vorherigen Problems ist.
....
Fehler traten auf beim Bearbeiten von:
 runit
 git-daemon-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

Have anyone a reason?

Revision history for this message
Warren (wseverin) wrote :

Get this message every time I try to update software from "Software Updater". Diagnostics presented are utterly useless in resolving the matter.

Revision history for this message
Pauline (plnlnc) wrote :

I have a fresh install of Ubuntu 15.10 and I get this message most of the time I try to install a software. I am unable to install git-all, and the install of TexMaker failed as well.

Revision history for this message
Pauline (plnlnc) wrote :

This is the message I get when trying to install a software or update:

Errors were encountered while processing:
 runit
 git-daemon-run
Error in function:
Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of git-daemon-run:
 git-daemon-run depends on runit; however:
  Package runit is not configured yet.

dpkg: error processing package git-daemon-run (--configure):
 dependency problems - leaving unconfigured

Revision history for this message
Pauline (plnlnc) wrote :

After some research, it seems that this problem was caused by git-all. Removing git-all fixed the problem for me.

https://bugs.launchpad.net/ubuntu/+source/runit/+bug/406621/comments/5
https://bugs.launchpad.net/ubuntu/+source/runit/+bug/406621/comments/6

Revision history for this message
Steven Shiau (stevenshiau) wrote :

I have similar issue on Ubuntu 16.04 beta 2 (updated on Apr/5/2016):
$ sudo apt-get install runit
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  socklog-run
The following NEW packages will be installed:
  runit
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/102 kB of archives.
After this operation, 503 kB of additional disk space will be used.
Selecting previously unselected package runit.
(Reading database ... 179854 files and directories currently installed.)
Preparing to unpack .../runit_2.1.2-3ubuntu1_amd64.deb ...
Unpacking runit (2.1.2-3ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 runit
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu Xenial Xerus (development branch)"

Even I followed
https://bugs.launchpad.net/ubuntu/+source/runit/+bug/406621/comments/5
to remove git-all, the issue still remains.

Steven

Revision history for this message
Thomas Prüfer (thouas) wrote :

Hi,

I had the same problem.

Fresh installation of 16.04 LTS and apt install git-all.

To get this solved purge runit and after this purge git & git-all.

Than install just the specific packages you need instead of git-all.

Also letsencrypt do not need all of it!

// Thomas

Revision history for this message
Edward (edlee-wwp) wrote :

Hi,

Confirmed the instructions per Git's site using 'git-all' throws this error on Ubuntu 16.04 for me also.

Resolving as Thomas Prufer indicated solves this issue.

Thanks.
/ Edward

tags: added: xenial yakkety
Revision history for this message
tony.vandenhaag (tony-vandenhaag) wrote :

On a fresh install of Ubuntu 16.04 apt-get install git-all fails with:

Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

Some other packages such as dconf-tools fail with the same error.

The error message refers to upstart, and upstart is installed on the system but it's not running. Instead the system uses systemd:

   dpkg: ii upstart 1.13.2-0ubuntu21 amd64 event-based init daemon - essential binaries
   ps aux: root 1 0.2 0.0 185368 484 ? Ss 16:43 0:02 /sbin/init auto noprompt
   ls -l: /sbin/init -> /lib/systemd/systemd

The error message also refers to runit. Downloading the runit .deb package and unpacking it shows the problem is the postinstall script. The postinstall script first tries to start runit using init, then systemd and then upstart.

The problem is, even though runit is successfuly started by systemd the postinstall script will later try to use upstart. Since upstart is not running it cannot be connected to, which then causes the error "... Failed to connect to socket /com/ubuntu/upstart..."

Here is the line where runit is started by systemd:
   test ! -d /run/systemd/system || systemctl start runit.service
If systemctl start runit, then at this point the script should stop.

Instead several lines later at the end of the file upstart is tried:
  if [ -x /sbin/start ]; then #provided by upstart
     /sbin/start runsvdir
  fi

Workaround: Install runit
            Steps:
            If needed, purge failed packages such as git-all, git-daemon-run
            apt-get update
            rm /sbin/start
            apt-get install runit # can also install git-all and runit will also be installed
            ln -s /sbin/initctl /sbin/initctl
            apt-get install git-all # or other package such as dconf-tools
            (all commands require sudo)
fix: Change the logic in the postinstall script in the runit .deb package to not start runit by upstart if it has already been started by systemd

All individual git packages such as git-el can be installed separately - except git-daemon-run which is the package in git-all needing runit. Other packages requiring runit(e.g., dconf-tools) can also be installed using the workaround. Once the runit package is successfuly installed the workaround is no longer needed. If git-all is successfuly installed using the workaround then runit is also successfully installed and no other packages will fail with "Failed to connect to socket /com/ubuntu/upstart: Connection refused." It goes without saying there is not an upstart bug and only going back to upstart will solve it...

BTW - a fresh install of 16.04 server does not have upstart installed so git-all installs with no errors.

Revision history for this message
tony.vandenhaag (tony-vandenhaag) wrote :

Just noticed a typo in the previous update:
ln -s /sbin/initctl /sbin/initctl should read ln -s /sbin/initctl /sbin/start

Revision history for this message
tony.vandenhaag (tony-vandenhaag) wrote :

One final correction: after re-reading the previous posts, on 2-8-2016 the package qmail-run was cited, and in my post the package dconf-tools should have been qmail-run. To be clear, dconf-tools does not depend on runit and should not have been used as an example but qmail-run does depend on runit and should have been used instead. Qmail-run will install with the workaround.

Revision history for this message
Pablo Carranza (pcarranza) wrote :

The workaround works perfectly fine, I've just installed runit in xenial this way.

Thanks Tony.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Can anybody please confirm this works in upcoming Ubuntu 16.10?
thanks

Revision history for this message
Szymon Piszczek (szymon-piszczek) wrote :

Problem still exist in fresh installation of 16.04.1 on November of 2016.
But below procedure worked for me
http://askubuntu.com/questions/765565/how-to-fix-processing-with-runit-and-git-daemon-run
sudo apt-get purge runit
sudo apt-get purge git-all
sudo apt-get purge git
sudo apt-get autoremove
sudo apt update
sudo apt install git

Revision history for this message
Chandu (chandujr) wrote :

The bug exists in Elementary OS 0.4 Loki. Szymon's method worked for me.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>Can anybody please confirm this works in upcoming Ubuntu 16.10?
>thanks

Hi, LocutusOfBorg

I tested this on Ubuntu 16.10 and I am no longer able to trigger this issue when installing runit. I am not familiar enough with the package to say much beyond this, though. :)

Revision history for this message
Joey Richmond (jeyskye) wrote : Re: [Bug 1448164] Re: runit cannot be installed (Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused)

I no longer use Ubuntu as Antergos has proven to be far superior

Sent from my iPhone

On Jan 2, 2017, at 10:22 AM, Hans Joachim Desserud <email address hidden> wrote:

>> Can anybody please confirm this works in upcoming Ubuntu 16.10?
>> thanks
>
> Hi, LocutusOfBorg
>
> I tested this on Ubuntu 16.10 and I am no longer able to trigger this
> issue when installing runit. I am not familiar enough with the package
> to say much beyond this, though. :)
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1650448).
> https://bugs.launchpad.net/bugs/1448164
>
> Title:
> runit cannot be installed (Unable to connect to Upstart: Failed to
> connect to socket /com/ubuntu/upstart: Connection refused)
>
> Status in runit package in Ubuntu:
> Confirmed
>
> Bug description:
> In Ubuntu 15.04 "runit" cannot be installed. postinst fails with the
> following message:
>
> start: Unable to connect to Upstart: Failed to connect to socket
> /com/ubuntu/upstart: Connection refused
>
> Due to this error, packages depending on runit, like git-daemon-run,
> cannot be installed as well.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/runit/+bug/1448164/+subscriptions

Changed in runit (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Franz Klotsche (franz-k) wrote :

Yes it's resolved. Will put a sign on it. Thank you and a happy new year.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

LocutusOfBorg: Do you know whether a fix will/could be SRUed to 16.04? There's quite a few duplicates on this issue and I believe more will be reported in the future.

Revision history for this message
Jithendra Myla (jithe1978) wrote :

these instructions helped me
sudo apt-get purge runit
sudo apt-get purge git-all
sudo apt-get purge git
sudo apt-get autoremove
sudo apt update
sudo apt install git

Thank you Szymo

Revision history for this message
Joey Richmond (jeyskye) wrote :

Unsubscribe!!!

Sent from my iPhone

> On Jan 4, 2017, at 12:27 PM, Jithendra Myla <email address hidden> wrote:
>
> these instructions helped me
> sudo apt-get purge runit
> sudo apt-get purge git-all
> sudo apt-get purge git
> sudo apt-get autoremove
> sudo apt update
> sudo apt install git
>
> Thank you Szymo
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1650448).
> https://bugs.launchpad.net/bugs/1448164
>
> Title:
> runit cannot be installed (Unable to connect to Upstart: Failed to
> connect to socket /com/ubuntu/upstart: Connection refused)
>
> Status in runit package in Ubuntu:
> Fix Released
>
> Bug description:
> In Ubuntu 15.04 "runit" cannot be installed. postinst fails with the
> following message:
>
> start: Unable to connect to Upstart: Failed to connect to socket
> /com/ubuntu/upstart: Connection refused
>
> Due to this error, packages depending on runit, like git-daemon-run,
> cannot be installed as well.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/runit/+bug/1448164/+subscriptions

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@Joey, just click on "unsubscribe"

@Hans, sorry but more than 3k line of code changed in the meanwhile, new subpackages have been added and some others removed, the system has been mostly completely rewritten, an SRU is mostly impossible, but if you want to give me a patch I'll check/sponsor it

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>an SRU is mostly impossible, but if you want to give me a patch I'll check/sponsor it

:( Thanks for your reply, I was just checking. I feared the answer would be something along those lines when you hadn't mentioned it initially.

Revision history for this message
Robie Basak (racb) wrote :

20:27 <hjd> Could someone add a Xenial task for bug 1448164? Looks like it would be hard to patch, but might be easier to find if there's an open Xenial task for the issue.

We can add a Xenial task as the bug impacts Xenial, but perhaps it should be Won't Fix since we don't intend to actually fix it? Otherwise we might set the expectation that it is waiting to be fixed in Xenial, which wouldn't be true.

Changed in runit (Ubuntu Xenial):
status: New → Won't Fix
tags: added: bugpattern-written
Changed in runit (Ubuntu Xenial):
status: Won't Fix → Triaged
importance: Undecided → High
assignee: nobody → Dimitri John Ledkov (xnox)
milestone: none → ubuntu-16.04.3
Revision history for this message
Krellan (krellan) wrote :

Although not strictly Ubuntu, I can confirm this bug happens on Linux Mint 18.3 "Sylvia", Cinnamon 64-bit. This helped me fix it:

sudo apt-get purge runit
sudo apt-get purge git-daemon-run
sudo apt-get install -f

It is not necessary to purge git-all or git packages. Keep the rest, only get rid of runit and git-daemon-run. After doing this, Git works fine on my system, and apt-get is clean.

Revision history for this message
Tarcio Vinicius Nieri (tv.nieri) wrote :

Same thing here, Ubuntu 16.04.
Seg Fev 19 22:24:46 -03 2018
Linux ubuntuOS 4.13.0-32-generic #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Juergen (luciljus) wrote :

Confirming for an up-to-date Xubuntu 16.04.4 LTS

Could work around by installing 'git' instead of 'git-all'.

However, I don't understand why it says "Fix released" because nothing has changed since 2015. It is still impossible to install 'git-daemon-run' on Ubuntu LTS.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>I don't understand why it says "Fix released" because nothing has changed since 2015.

The Fix Released status refers to Ubuntu in general. If a bug is fixed in the latest version (like this is), then the bug is considered fixed. (See https://wiki.ubuntu.com/Bugs/Bug%20statuses for more details and description on bug statuses)

However, as you mention this still affect some releases, like 16.04 (code named Xenial). The Xenial task which is currently marked as Triaged is tracking this. So it says that the bug is fixed in newer releases, but 16.04 is still missing a patch. Unfortunately, making a patch for this issue isn't neccessarily trivial, see also the discussion in comments #25-#30. Though someone changed their mind and marked it as Triaged for 16.04, so something might happen...

Changed in runit (Ubuntu):
assignee: nobody → Pranjal Bharti (pranjalbharti)
Revision history for this message
JCD (jchd) wrote :

The issue is still there: when I try to apt install git-all on my fresh Ubuntu 16.04 install, runit crashes with an output similar to @tony.vandenhaag, without any reference to dconf-tools or any package other than runit and git-daemon-run.

I found the solution is this thread:
https://forum.peppermintos.com/index.php?topic=5210.0

Apparently, it's a problem with the postinst (post installation) script in the upstream "runit" package that is attempting to configure runit for BOTH systemd AND upstart, but though upstart is installed, it's NOT the active init system so upstarts "/sbin/start runsvdir" fails, the postinst script throws an error, and dpkg stops the installation/configuration.

Solution:
- In file /var/lib/dpkg/info/runit.postinst, comment lines
if [ -x /sbin/start ]; then #provided by upstart
  /sbin/start runsvdir
fi
- Save and quit
- Finish runit installation by running sudo dpkg --configure -a
- Uncomment previously commented lines

Revision history for this message
Matheus Bruhns Bastos (matbbastos) wrote :

On 16.04 I still had this issue, even after following the uninstall-purge-autoremove-install (git-all, git and runit). Followed what @JCD(jchd) mentioned and it worked out.

Solution:
- $ sudo apt install runit # should return error
- In file /var/lib/dpkg/info/runit.postinst, comment lines
if [ -x /sbin/start ]; then #provided by upstart
  /sbin/start runsvdir
fi
- Save and quit
- Finish runit installation: $ sudo dpkg --configure -a
- Uncomment previously commented lines

Revision history for this message
Gerardo Gomez (clonehazard) wrote :

Thanks for the update.

El vie., 5 mar. 2021 21:04, Matheus Bruhns Bastos <
<email address hidden>> escribió:

> On 16.04 I still had this issue, even after following the uninstall-
> purge-autoremove-install (git-all, git and runit). Followed what
> @JCD(jchd) mentioned and it worked out.
>
> Solution:
> - $ sudo apt install runit # should return error
> - In file /var/lib/dpkg/info/runit.postinst, comment lines
> if [ -x /sbin/start ]; then #provided by upstart
> /sbin/start runsvdir
> fi
> - Save and quit
> - Finish runit installation: $ sudo dpkg --configure -a
> - Uncomment previously commented lines
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1739935).
> https://bugs.launchpad.net/bugs/1448164
>
> Title:
> runit cannot be installed (Unable to connect to Upstart: Failed to
> connect to socket /com/ubuntu/upstart: Connection refused)
>
> Status in xpl-perl:
> New
> Status in runit package in Ubuntu:
> Fix Released
> Status in runit source package in Xenial:
> Triaged
>
> Bug description:
> In Ubuntu 15.04 "runit" cannot be installed. postinst fails with the
> following message:
>
> start: Unable to connect to Upstart: Failed to connect to socket
> /com/ubuntu/upstart: Connection refused
>
> Due to this error, packages depending on runit, like git-daemon-run,
> cannot be installed as well.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xpl-perl/+bug/1448164/+subscriptions
>

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.