目录
- 问题描述
- Warning: Stopping docker.service, but it can still be activated by: docker.socket
- 原因
-
- 解决方案一
- 解决方案二
- 总结
问题描述
使用docker时,
每次停止docker systemctl stop docker 命令执行完都会提示
Warning: Stopping docker.service, but it can still be activated by: docker.socket
原因
目前找到的问题原因是:
This is because in addition to the docker.service unit file, there is a docker.socket unit file… this is for socket activation. The warning means if you try to connect to the docker socket while the docker service is not running, then systemd will automatically start docker for you. You can get rid of this by removing /lib/systemd/system/docker.socket… you may also need to remove -H fd:// from the docker.service unit file.
来源:stack overflow
解释
这是因为除了docker.service单元文件,还有一个docker.socket单元文件…docker.socket这是用于套接字激活。
该警告意味着:如果你试图连接到docker socket,而docker服务没有运行,系统将自动启动docker。
解决方案一
你可以删除 /lib/systemd/system/docker.socket
从docker中 docker.service 文件 删除 fd://,即remove -H fd://
解决方案二
如果不想被访问时自动启动服务
输入命令:sudo systemctl stop docker.socket
总结
其实这是个挺人性化的设计,知道意思后,就不想采取什么干预了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)