由于我尝试设置加密交换分区(加密交换分区未显示在 /dev/mapper 中networking.service
),启动时出现无法启动的错误。
这是我运行错误消息中描述的命令时获得的信息:
$ systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: failed (Result: exit-code) since Mi 2016-08-10 22:57:45 CEST; 10min ago
Docs: man:interfaces(5)
Process: 4424 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 4417 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=l
Main PID: 4424 (code=exited, status=1/FAILURE)
Aug 10 22:57:45 BC-AlkaliMetal systemd[1]: Starting Raise network interfaces...
Aug 10 22:57:45 BC-AlkaliMetal ifup[4424]: RTNETLINK answers: File exists
Aug 10 22:57:45 BC-AlkaliMetal ifup[4424]: Failed to bring up lo.
Aug 10 22:57:45 BC-AlkaliMetal systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Aug 10 22:57:45 BC-AlkaliMetal systemd[1]: Failed to start Raise network interfaces.
Aug 10 22:57:45 BC-AlkaliMetal systemd[1]: networking.service: Unit entered failed state.
Aug 10 22:57:45 BC-AlkaliMetal systemd[1]: networking.service: Failed with result 'exit-code'.
谢谢 @林兹温德,这个问题可以暂时的可以通过冲洗设备来解决lo
:
bytecommander@BC-AlkaliMetal:~$ sudo ip addr flush dev lo
bytecommander@BC-AlkaliMetal:~$ sudo service networking start
bytecommander@BC-AlkaliMetal:~$ systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: active (exited) since Mi 2016-08-10 22:55:06 CEST; 5s ago
Docs: man:interfaces(5)
Process: 9057 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
Process: 9052 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=l
Main PID: 9057 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/networking.service
Aug 10 22:55:06 BC-AlkaliMetal systemd[1]: Starting Raise network interfaces...
Aug 10 22:55:06 BC-AlkaliMetal systemd[1]: Started Raise network interfaces.
但是下次重启时我又遇到了同样的问题。
这是我的/etc/network/interfaces
配置文件:
# interfaces(5) file used by ifup(8) and ifdown(8)
iface lo inet static
address 127.0.0.1
netmask 255.0.0.0
这里有什么问题?如何修复?
答案1
环回接口配置不正确/etc/network/inerfaces
:
iface lo inet static
address 127.0.0.1
netmask 255.0.0.0
环回接口 ( lo
) 被视为系统“特殊”接口,需要进行分类。为了便于分类,应删除对环回接口的所有引用,并将其替换为默认接口:
auto lo
iface lo inet loopback
进行此更改后重新启动networking
服务应允许系统正确抓取它并修复启动时的错误lo
。