containerd 日志

[root@localhost containerd]# ps -ef |grep containerd
root      123680       1  0 04:17 ?        00:00:00 /usr/bin/containerd
root      123712  116513  0 04:18 pts/2    00:00:00 grep --color=auto containerd
[root@localhost containerd]# ll /proc/123680/fd
total 0
lr-x------. 1 root root 64 12月  1 04:17 0 -> /dev/null
lrwx------. 1 root root 64 12月  1 04:17 1 -> 'socket:[4535980]'
lr-x------. 1 root root 64 12月  1 04:17 10 -> 'pipe:[4534326]'
l-wx------. 1 root root 64 12月  1 04:17 11 -> 'pipe:[4534326]'
lrwx------. 1 root root 64 12月  1 04:17 12 -> 'socket:[4534327]'
lrwx------. 1 root root 64 12月  1 04:17 13 -> 'socket:[4532400]'
lrwx------. 1 root root 64 12月  1 04:17 14 -> /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/metadata.db
lrwx------. 1 root root 64 12月  1 04:17 16 -> 'socket:[4537166]'
lrwx------. 1 root root 64 12月  1 04:17 2 -> 'socket:[4535980]'
lrwx------. 1 root root 64 12月  1 04:17 3 -> /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db
lrwx------. 1 root root 64 12月  1 04:17 4 -> 'anon_inode:[eventpoll]'
lr-x------. 1 root root 64 12月  1 04:17 5 -> 'pipe:[4535983]'
l-wx------. 1 root root 64 12月  1 04:17 6 -> 'pipe:[4535983]'
lrwx------. 1 root root 64 12月  1 04:17 7 -> 'anon_inode:[eventpoll]'
lr-x------. 1 root root 64 12月  1 04:17 8 -> anon_inode:inotify
lrwx------. 1 root root 64 12月  1 04:17 9 -> 'anon_inode:[eventpoll]'

  创建容器后ctr  run  -d --log-uri=file:///abc.txt docker.io/library/centos:7 test2  sh  -c "while true;do date ;sleep 1;done"

[root@localhost containerd]# ll /proc/123680/fd
total 0
lr-x------. 1 root root 64 12月  1 04:17 0 -> /dev/null
lrwx------. 1 root root 64 12月  1 04:17 1 -> 'socket:[4535980]'
lr-x------. 1 root root 64 12月  1 04:17 10 -> 'pipe:[4534326]'
l-wx------. 1 root root 64 12月  1 04:17 11 -> 'pipe:[4534326]'
lrwx------. 1 root root 64 12月  1 04:17 12 -> 'socket:[4534327]'
lrwx------. 1 root root 64 12月  1 04:17 13 -> 'socket:[4532400]'
lrwx------. 1 root root 64 12月  1 04:17 14 -> /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/metadata.db
lrwx------. 1 root root 64 12月  1 04:17 16 -> 'socket:[4537166]'
l---------. 1 root root 64 12月  1 04:17 17 -> /run/containerd/io.containerd.runtime.v2.task/default/test2/log
lrwx------. 1 root root 64 12月  1 04:17 18 -> /run/containerd/io.containerd.runtime.v2.task/default/test2/log
lrwx------. 1 root root 64 12月  1 04:17 19 -> 'socket:[4534379]'
lrwx------. 1 root root 64 12月  1 04:17 2 -> 'socket:[4535980]'
lrwx------. 1 root root 64 12月  1 04:17 20 -> 'socket:[4534381]'
lrwx------. 1 root root 64 12月  1 04:17 3 -> /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db
lrwx------. 1 root root 64 12月  1 04:17 4 -> 'anon_inode:[eventpoll]'
lr-x------. 1 root root 64 12月  1 04:17 5 -> 'pipe:[4535983]'
l-wx------. 1 root root 64 12月  1 04:17 6 -> 'pipe:[4535983]'
lrwx------. 1 root root 64 12月  1 04:17 7 -> 'anon_inode:[eventpoll]'
lr-x------. 1 root root 64 12月  1 04:17 8 -> anon_inode:inotify
lrwx------. 1 root root 64 12月  1 04:17 9 -> 'anon_inode:[eventpoll]'

 发现多了

l---------. 1 root root 64 12月  1 04:17 17 -> /run/containerd/io.containerd.runtime.v2.task/default/test2/log
lrwx------. 1 root root 64 12月  1 04:17 18 -> /run/containerd/io.containerd.runtime.v2.task/default/test2/log

往 echo 1234 > /run/containerd/io.containerd.runtime.v2.task/default/test2/log 会写道containerd的标准输出(shim的日志,containerd通过读取获得)

posted @ 2022-12-01 17:23  rincloud  阅读(742)  评论(0)    收藏  举报