问题描述
刚刚通过do-release-upgrade更新,现在某些新手工作,如fail2ban和plexmediaserver将无法启动(尝试重新安装)
$ 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
有什么想法从哪里开始?
最佳解决方案
Ubuntu在15.04开始作为服务框架切换到systemd
,用于所有风格,包括桌面和服务器。建议的做法是将upstart
作业更改为systemd
作业(有关详细信息,请参阅Wiki文章)。如果需要,您也可以切换回upstart
,这肯定是更快的修复。我建议你阅读维基文章的前几节来衡量利弊。
推荐修复
请参阅Wiki文章,将upstart
脚本转换为systemd
。
讨论和编码指南:Systemd For Upstart Users
快速修复(仅限15.04)
要永久切换回upstart
,只需运行:
sudo apt-get install upstart-sysv
sudo update-initramfs -u
sudo reboot
编辑:维基文章仅推荐15.04,但一些用户也发现它在16.04也有帮助。
次佳解决方案
我发现fail2ban的问题是配置文件中的错误:/etc/fail2ban/jail.local
在pam部分中,端口变量列出两次
[pam-generic]
...
port = all
banaction = iptables-allports
port = anyport
即使在我的配置中禁用了此部分(enabled = false
),也会导致错误。我只是评论了第二个定义
# port = anyport
我通过手动运行fail2ban找到了这个:
sudo fail2ban-client start