Ubuntu 14.04及之后版本重启网卡不生效

Ubuntu 14.04修改配置,重启网卡没有生效,出现如下问题:

$ service networking restart //重启网络服务
stop: Job failed while stopping
start: Job is already running: networking


$ tail -f /var/log/upstart/networking.log //查看错误日志
Stopping or restarting the networking job is not supported.
Use ifdown & ifup to reconfigure desired interface.

从以上日志内容可以看出,传统的service重启和停止网络已经不再支持了,需要通过使用ifdown & ifup来实现相应的操作。

$ sudo ifdown eth0 

$ sudo ifup eth0

如果在远程Shell操作的情况,上面的命令可能会只执行了ifdown,然后连接就断开,而无法执行后面的ifup命令,导致无法继续操作。

解决方法是把上面的命令写入一个脚本文件执行:

$ echo 'ifdown eth0 && ifup eth0' >> restart_eth.sh

$ chmod +x restart_eth.sh 

$ sudo ./restart_eth.sh

参考连接


linux Ubuntu14.04及之后版本重启网卡不生效

OpenMediaVault-4.0.15执行更新(apt update)时报错“TypeError: 'NoneType' object is not callable”

OpenMediaVault-4.0.15执行更新(apt update)时报错,详细错误信息如下:

命中:12 http://packages.openmediavault.org/public arrakis InRelease            
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f7dc337b730>
Traceback (most recent call last):
  File "/usr/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f7dc337b730>
Traceback (most recent call last):
  File "/usr/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable

通过观察发现,只要从packages.openmediavault.org中下载文件失败,就会报告这个错误。

发生错误之后,重新执行

$ sudo apt update

即可解决这个问题,或者忽略这个错误信息即可。