vivid - failed to connect to upstart: connection refused

231,333

Solution 1

Ubuntu switched to systemd as its service framework starting in 15.04 for all flavors, including Desktop and Server. The recommended practice is to change your upstart jobs to systemd jobs (see the wiki article for more info). You can also switch back to upstart if you want, which is certainly the quicker fix. I recommend you read the first few sections of the wiki article to weight the pros and cons.

Recommended Fix

Refer to the wiki article to transition your upstart scripts to systemd.

Discussion and coding guide: Systemd For Upstart Users

Quick Fix (for 15.04 only)

To permanently switch back to upstart just run:

sudo apt-get install upstart-sysv
sudo update-initramfs -u
sudo reboot

EDIT: The wiki article only recommends this for 15.04, but some users have found it helpful on 16.04 too.

Solution 2

I found the problem for fail2ban was an error in the configuration file: /etc/fail2ban/jail.local

In the pam section, the port variable is listed twice

[pam-generic]

...

port     = all
banaction = iptables-allports
port     = anyport

Even though this section is disabled (enabled = false) in my configuration, this causes an error. I simply commented out this second definition

# port     = anyport

I found this by running fail2ban manually:

sudo fail2ban-client start

Solution 3

Here the solution. It's all about the recent VirtualBox update.

Run in terminal (Ctrl+Alt+F1 if you are acceding from recovery mode):

sudo apt-get purge virtualbox-guest-x11
Share:
231,333

Related videos on Youtube

matty87a
Author by

matty87a

Updated on September 18, 2022

Comments

  • matty87a
    matty87a over 1 year

    Just updated via do-release-upgrade and now certain upstart jobs such as fail2ban and plexmediaserver will not start (have tried reinstalling)

    $ sudo service fail2ban start
    Job for fail2ban.service failed. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
    
    $ systemctl status fail2ban.service
      fail2ban.service - Fail2Ban Service
       Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
       Active: failed (Result: start-limit) since Mon 2015-04-27 19:47:27 BST; 26s ago
         Docs: man:fail2ban(1)
      Process: 14423 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
    
    $ sudo service plexmediaserver start
    Failed to start plexmediaserver.service: Unit plexmediaserver.service failed to load: No such file or directory.
    
    $ sudo dpkg -i plexmediaserver_0.9.11.16.958-80f1748_amd64.deb
    (Reading database ... 88738 files and directories currently installed.)
    Preparing to unpack plexmediaserver_0.9.11.16.958-80f1748_amd64.deb ...
    stop: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
    

    Any ideas with where to start on this?

    • TheSchwa
      TheSchwa about 9 years
      Can you add the contents of /lib/systemd/system/fail2ban.service to your post? The failed (Result: start-limit) indicates that the service is constantly failing and trying to restart, and systemd is limiting how many times it starts in a given time period. Also wondering if this bug report is relevant.
    • LF00
      LF00 over 6 years
  • TheSchwa
    TheSchwa about 9 years
    Taking a closer look at the output you posted, the job is apparently trying to start using systemd and not upstart. Notice that systemctl is mentioned several times, which is the command line interface to systemd. In addition, the Failed to connect to socket error suggests that upstart is not running at all. It looks like fail2ban is trying to use systemd but the script has an error, and plexmediaserver is trying to use upstart which no longer exists.
  • TheSchwa
    TheSchwa about 9 years
    See also askubuntu.com/questions/600026/… regarding plexmediaserver on 15.04
  • Ashley
    Ashley almost 9 years
    I got this also. I guess the example configs between versions was non-compatible.
  • BobTuckerman
    BobTuckerman over 7 years
    @Kape Yes, it's being replaced by systemd. I do believe however that almost all of the upstart jobs will be backwards compatible to minimize the impact to end users during the transition process.
  • JqueryToAddNumbers
    JqueryToAddNumbers over 7 years
    the quick fix screwed up my ubuntu install (16.04) had to boot into recovery mode, with root prompt and type: apt-get remove upstart-sysv and update-initramfs -u to get everything working again
  • TheSchwa
    TheSchwa over 7 years
    @ExceptionSlayer srry to hear that :( I added a note in the answer about versions, since from the wiki "If you are running Ubuntu vivid (15.04), you can easily switch between upstart and systemd at will since both packages are installed at present."
  • Robin Zimmermann
    Robin Zimmermann over 7 years
    That happened to me, too, @ExceptionSlayer. Thank you for the instructions.
  • Greg G
    Greg G about 7 years
    Thank you @ExceptionSlayer for your comment and saving my system. This quick fix screwed up my ubuntu install (16.04) as well.