如何修复 Debian wheezy 中的“insserv:如果启动,服务 mountnfs 和 nfs-common 之间存在循环”?

如何修复 Debian wheezy 中的“insserv:如果启动,服务 mountnfs 和 nfs-common 之间存在循环”?

我正在开发一个 Debian wheezy x64 盒子,dist-upgrade 为:

Debian 7.7 (wheezy) 64-bit
kernel Linux 3.2.0-4-amd64

它配置了 Linux RAID10、dm-crypt/LUKS 和 LVM。我已经从virtualbox-4.3_4.3.20-96996~Debian~wheezy_amd64.deb.

虽然它可以启动并运行软件,但 insserv 的某些部分被破坏了。例如:

root@debian:/home/user# apt-get install iptables-persistent
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  iptables-persistent
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/10.3 kB of archives.
After this operation, 61.4 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package iptables-persistent.
(Reading database ... 133127 files and directories currently installed.)
Unpacking iptables-persistent (from .../iptables-persistent_0.5.7_all.deb) ...
Setting up iptables-persistent (0.5.7) ...
insserv: There is a loop between service mountnfs and nfs-common if started
insserv:  loop involving service nfs-common at depth 12
insserv:  loop involving service rpcbind at depth 10
insserv:  loop involving service mountnfs at depth 13
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing iptables-persistent (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 iptables-persistent
E: Sub-process /usr/bin/dpkg returned an error code (1)

我得到的错误基本上与root@debian:/home/user# apt-get install -f.但是,其他一些软件包安装成功:

root@debian:/home/user# apt-get install p7zip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  p7zip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 386 kB of archives.
After this operation, 1,010 kB of additional disk space will be used.
Get:1 http://ftp.at.debian.org/debian/ wheezy/main p7zip amd64 9.20.1~dfsg.1-4 [386 kB]
Fetched 386 kB in 1s (299 kB/s)
Selecting previously unselected package p7zip.
(Reading database ... 133131 files and directories currently installed.)
Unpacking p7zip (from .../p7zip_9.20.1~dfsg.1-4_amd64.deb) ...
Processing triggers for man-db ...
Setting up iptables-persistent (0.5.7) ...
insserv: There is a loop between service mountnfs and nfs-common if started
insserv:  loop involving service nfs-common at depth 12
insserv:  loop involving service rpcbind at depth 10
insserv:  loop involving service mountnfs at depth 13
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing iptables-persistent (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up p7zip (9.20.1~dfsg.1-4) ...
Errors were encountered while processing:
 iptables-persistent
E: Sub-process /usr/bin/dpkg returned an error code (1)

但 iptables-persistent 的安装仍然无法完成。

更新 nfs-common 运行级别默认值没有帮助,并显示相同的错误:

root@debian:/home/user# update-rc.d nfs-common defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match nfs-common Default-Start values (2 3 4 5 S)
insserv: There is a loop between service mountnfs and nfs-common if started
insserv:  loop involving service nfs-common at depth 12
insserv:  loop involving service rpcbind at depth 10
insserv:  loop involving service mountnfs at depth 13
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header

谷歌没有向我展示任何有用的东西。和这里唯一类似的问题幸运的是不相关。

我该如何解决这个问题?我知道 nfs-common 的运行级别不匹配可能是相关的,但我不明白如何继续。

编辑:按照 wurtel 的建议,鉴于我没有使用 nfs,我已经删除了 mountnfs、nfs-common 和 rpcbind。我必须按顺序删除它们,以避免循环错误。但设置默认值失败:

root@debian:/home/user# update-rc.d -f rpcbind defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match rpcbind Default-Start values (S 2 3 4 5)
root@debian:/home/user# update-rc.d -f nfs-common defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match nfs-common Default-Start values (2 3 4 5 S)
insserv: There is a loop between service mountnfs and nfs-common if started
insserv:  loop involving service nfs-common at depth 14
insserv:  loop involving service rpcbind at depth 12
insserv:  loop involving service mountnfs at depth 16
insserv: There is a loop between service mountnfs and nfs-common if started
insserv:  loop involving service rsyslog at depth 17
root@debian:/home/user# update-rc.d -f mountnfs defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/mountnfs

好的一面是,一旦我再次成功删除 mountnfs、nfs-common 和 rpcbind,我就可以安装和配置 iptables-persistent。然而,我留下了update-rc.d: error: unable to read /etc/init.d/mountnfsrpcbind 和 nfs-common 不匹配的默认启动运行级别值。

更糟糕的是,我发现设置默认值对于/etc/default/.对于某些人来说,这是“无法阅读”。例如:

root@debian:/etc/iptables# update-rc.d grub defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/grub

对于其他人来说,这是默认的启动运行级别不匹配。例如:

root@debian:/etc/default# update-rc.d halt defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match halt Default-Start values (none)
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match halt Default-Stop values (0)

其余的工作。例如:

root@debian:/etc/default# update-rc.d exim4 defaults
update-rc.d: using dependency based boot sequencing

但是,在删除了 mountnfs、nfs-common 和 rpcbind 后,我没有看到其中任何一个的循环错误。所以这似乎只是 rc.d 错误的症状。

但我认为这应该是另一个问题。

答案1

我有类似的问题。删除initscripts.*自/var/lib/dpkg/info

之后运行apt-get install -f即可解决问题。

解决方案取自这里

相关内容