51

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?

  • 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. – TheSchwa Apr 28 '15 at 17:09
  • status: Unable to connect to Upstart: may helps – Kris Roofe Oct 28 '17 at 11:45
53

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.

  • 1
    Surely systemd is only the default on newly installed systems, not on systems that were upgraded from 14.10? – Jos Apr 28 '15 at 10:08
  • 1
    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 Apr 28 '15 at 16:44
  • 3
    Is Upstart discontinued now? I just liked how easy it was to create new services.. – Kapé Aug 30 '16 at 20:12
  • 6
    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 – ExceptionSlayer Jan 13 '17 at 7:39
  • 1
    That happened to me, too, @ExceptionSlayer. Thank you for the instructions. – Robin Zimmermann Jan 25 '17 at 21:13
5

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
  • I got this also. I guess the example configs between versions was non-compatible. – Ash Jul 27 '15 at 2:36
1

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
0

In my case where the Ubuntu version was upgraded, it was just the way we run command in case of the new Ubuntu version :

New command which works:

 sudo service ssh restart

To check tcp is listening on port 22, you should get some output from this command : sudo netstat -anp | grep sshd

To check ssh is running :

  1. eval ssh-agent
  2. ps -aux | grep ssh

Note: We are considering that the key required to ssh is loaded in the ssh agent from the box where ssh is being initiated and the key is also added to .ssh/authorized_keys file on the box in which ssh is being done.

-3

I had this problem after upgrading a Linux VM (VirtualBox).

Turns out I had to run VBoxLinuxAdditions.run from the pseudo-terminal as root and reboot to fix this.

FYI in case anyone out there has the same problem.

David

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.