【发布时间】:2017-05-23 20:29:05
【问题描述】:
每次我启动 Lubuntu 16.04 笔记本电脑时,我都会看到我有一个正在运行的 docker 容器:
$ ps -ef | grep docker
root 1724 1 3 21:17 ? 00:01:30 /usr/bin/dockerd -H fd://
root 1774 1724 0 21:17 ? 00:00:04 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root 4750 1774 0 21:17 ? 00:00:00 docker-containerd-shim 72541a4648b890132985daf2357d1130b8b5208cf12ede607b93ab2987629719 /var/run/docker/libcontainerd/72541a4648b890132985daf2357d1130b8b5208cf12ede607b93ab2987629719 docker-runc
stephane 10755 1793 0 22:07 pts/0 00:00:00 grep docker
它在端口 80 上为 Jenkins 应用程序提供服务,并在浏览器中请求 localhost/ 重定向到 http://localhost/login?from=%2F 并显示 Jenkins 警告页面:
Unlock Jenkins
To ensure Jenkins is securely set up by the administrator, a password has been written to the log (not sure where to find it?) and this file on the server:
一个 wget 请求显示:
$ wget localhost/
--2017-05-23 22:09:55-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2017-05-23 22:09:55 ERROR 403: Forbidden.
我如何知道哪个服务正在启动这个 docker 进程?
我查看了/etc/init.d/ 目录:
$ l /etc/init.d/
alsa-utils* checkroot-bootclean.sh* halt* mattermostd* nginxd* rc* single* uuidd*
anacron* checkroot.sh* hostname.sh* mountall-bootclean.sh* ntp* rc.local* skeleton whoopsie*
apachedsd* console-setup* httpd* mountall.sh* ondemand* rcS* ssh* x11-common*
apparmor* cron* hwclock.sh* mountdevsubfs.sh* openvpn* README tomcatd*
apport* cups* irqbalance* mountkernfs.sh* php-fpm* reboot* udev*
avahi-daemon* cups-browsed* keyboardd* mountnfs-bootclean.sh* plymouth* redis* ufw*
bluetooth* dbus* killprocs* mountnfs.sh* plymouth-log* resolvconf* umountfs*
bootmisc.sh* docker* kmod* mysqld* postfix* rsync* umountnfs.sh*
cgroupfs-mount* dropboxd* lightdm* networking* pppd-dns* rsyslog* umountroot*
checkfs.sh* grub-common* mariadbd* network-manager* procps* sendsigs* urandom*
/etc/init.d/docker 是我的,将其从目录中删除,重新启动仍然会出现一个正在运行的 docker 进程。
我删除了/etc/init.d/docker文件,重启,有一个docker进程:
$ ps -ef | grep docker
root 1560 1 5 22:15 ? 00:00:06 /usr/bin/dockerd -H fd://
root 1645 1560 0 22:15 ? 00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root 4644 1645 0 22:15 ? 00:00:00 docker-containerd-shim 069db46cca05d43c35f05ff50aaa836507cbf69e4e3d9443b6b859d0edb5b076 /var/run/docker/libcontainerd/069db46cca05d43c35f05ff50aaa836507cbf69e4e3d9443b6b859d0edb5b076 docker-runc
stephane 5520 1741 0 22:17 pts/0 00:00:00 grep docker
所以我在所有这些文件中查找了任何 docker 文件,但没有找到任何名为 docker 的文件:
$ cd /etc/init.d/
[stephane@stephane-ThinkPad-X301 init.d]
$ grep.sh docker
[stephane@stephane-ThinkPad-X301 init.d]
每次我启动笔记本电脑时,都会出现这个 docker 进程,即使在离线时也是如此。
什么会启动这个 docker 进程?
【问题讨论】:
-
在终端运行
systemctl的结果是什么? -
SO 是针对编程问题,而不是关于使用或配置 Linux 的问题。 SuperUser.com 或 unix.stackexchange.com 会更好地解决此类问题。
-
@OluwafemiSule 有相当大的输出。有什么具体的想法吗?
标签: linux ubuntu docker jenkins