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?

abu_bua
  • 11,313
matty87a
  • 511

5 Answers5

54

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.

Zanna
  • 72,312
TheSchwa
  • 3,860
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
Zanna
  • 72,312
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
Eliah Kagan
  • 119,640
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.

abu_bua
  • 11,313
-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