前段时间在Docker中安装了Openwrt,最近想删除这个WRT容器,发现删除就会导致飞牛系统重启,并且重启之后删除了的Openwrt又回来了。
经过排查发现,Openwrt容器是特权模式运行的且启动了看门狗,所以导致每次删除容器导致飞牛系统重启:
test@700:~$ sudo docker exec openwrt ls -l /proc/1/fd/
lr-x------ 1 root root 64 Feb 14 20:46 0 -> /dev/console
l-wx------ 1 root root 64 Feb 14 20:46 1 -> /dev/console
lrwx------ 1 root root 64 Feb 14 20:46 10 -> socket:[34256]
lr-x------ 1 root root 64 Feb 14 20:46 12 -> pipe:[27151]
lr-x------ 1 root root 64 Feb 14 20:46 13 -> pipe:[29115]
lr-x------ 1 root root 64 Feb 14 20:46 14 -> pipe:[33502]
lr-x------ 1 root root 64 Feb 14 20:46 15 -> pipe:[33525]
lr-x------ 1 root root 64 Feb 14 20:46 16 -> pipe:[33503]
lr-x------ 1 root root 64 Feb 14 20:46 18 -> pipe:[33526]
l-wx------ 1 root root 64 Feb 14 20:46 2 -> /dev/console
l-wx------ 1 root root 64 Feb 14 20:46 3 -> /dev/watchdog
lrwx------ 1 root root 64 Feb 14 20:46 4 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 14 20:46 5 -> pipe:[23318]
l-wx------ 1 root root 64 Feb 14 20:46 6 -> pipe:[23318]
lrwx------ 1 root root 64 Feb 14 20:46 7 -> socket:[23319]
lrwx------ 1 root root 64 Feb 14 20:46 8 -> socket:[26786]
lr-x------ 1 root root 64 Feb 14 20:46 9 -> anon_inode:inotify
test@700:~$
这一行验证了有看门狗:
l-wx------ 1 root root 64 Feb 14 20:46 3 -> /dev/watchdog
最后解决办法:
先停止Docker服务开机自启,然后断 电重启系统后把Openwrt容器删掉,再启动Docker服务。