我该如何解决这个问题(insserv)无法更新,无法自动运行应用程序

我该如何解决这个问题(insserv)无法更新,无法自动运行应用程序

我不知道我怎么会遇到这个问题,但我无法安装应用程序、更新、升级或自动运行应用程序。

$ sudo update-rc.d ums defaults
insserv: warning: script 'S99selinux' missing LSB tags and overrides
insserv: warning: script 'S97DbSecuritySpt' missing LSB tags and overrides
insserv: warning: script 'selinux' missing LSB tags and overrides
insserv: warning: script 'DbSecuritySpt' missing LSB tags and overrides
insserv: There is a loop between service plymouth and networking if started
insserv:  loop involving service networking at depth 3
insserv:  loop involving service procps at depth 2
insserv:  loop involving service iscsid at depth 6
insserv:  loop involving service urandom at depth 4
insserv: There is a loop between service plymouth and mountdevsubfs if started
insserv:  loop involving service mountdevsubfs at depth 2
insserv:  loop involving service udev at depth 1
insserv: Starting selinux depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting DbSecuritySpt depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting selinux depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting DbSecuritySpt depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting selinux depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting DbSecuritySpt depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting selinux depends on plymouth and therefore on system facility `$all' which can not be true!

答案1

问题:

insserv 帮助确定应该按什么顺序启动哪些服务。

示例:文件系统在网络之前启动,因为网络需要读取/写入文件。

这是一个笨拙的系统,早已被 Upstart(Ubuntu 14.04)取代,后来又被 systemd(Ubuntu 16.04)取代。但 insserv 仍然存在,以帮助非常古老的 sysvinit 服务适应新世界。

所有这些启动服务的方式都有一个共同点 - 它们讨厌循环。系统无法确定哪个服务应该先启动。

例如:A 在 B 之前开始。B 在 A 之前开始。

系统在安装或卸载软件包时会确定大部分启动顺序。调整启动顺序是配置新安装的软件包的一部分。

循环将导致错误。

该错误将阻止包的配置。

未配置的包将导致包管理器错误。

现在回过头来重新阅读整个错误信息。你可以看到 insserv 错误,它导致包安装失败,进而导致所有依赖包都失败。

还有一个元素:Apt,包管理器,记得您希望安装此软件包。每次启动 apt 时,它都会查看是否必须恢复任何未完成的安装。因此 apt 将继续尝试每次运行时都要安装这些包,但每次都会遇到相同的错误。

Apt 在第一次出现错误时终止,因此该错误可能会(无意中)阻止其他软件包操作,包括正常更新和安全补丁。

解决方案:

有几种方法可以处理这个问题。

1) 仔细阅读错误消息 您有四个脚本(两个名为“selinux”)没有任何 LSB 标头。这很不寻常 - 您是否尝试过以几种不同的方式安装 SELinux?如果是这样,请在继续之前清理您的旧尝试。只需编辑每个剩余的脚本,添加 LSB 标头以告诉系统何时应运行脚本。记下笔记,因为这是一个临时解决方案 - 软件包升级可能会抹去您的更改。

正确的 LSB 标头看起来像这样:

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

2) 除了缺少 LSB 标头和标签之外,您还有循环。回想一下,init 真的很讨厌循环。如果添加标头和标签不能解决问题,请编辑标签,以便 selinux 和其他脚本不依赖 plymouth...或更改 plymouth,使其不依赖 $all。

警告:请保留详细的笔记并准备好 LiveUSB——修改基本服务(如 plymouth)的启动顺序可能会破坏您的系统或导致其无法启动。

3) 或者,如果您不使用其中某些服务,只需卸载未使用的服务即可。循环中断,apt 应完成配置并安装。

4) 如果您使用的是 16.04 或更新版本,请向每个上游项目提交错误报告。Insserv 非常老旧且不完善,这些上游应该为您提供正确的 systemd-native .service 文件。

相关内容