Skip to content

systemd: ps/kill can't work when container is in stopped state #2337

@lifubang

Description

@lifubang

How to reproduce:

[root@bogon systemdtest]# runc --systemd-cgroup run -d test
[root@bogon systemdtest]# runc --systemd-cgroup list
ID          PID         STATUS      BUNDLE             CREATED                          OWNER
test        177063      running     /opt/systemdtest   2020-04-21T10:40:55.998063538Z   root
[root@bogon systemdtest]# runc --systemd-cgroup ps test
UID          PID    PPID  C STIME TTY          TIME CMD
root      177063       1  0 18:40 ?        00:00:00 sleep 20
[root@bogon systemdtest]# runc --systemd-cgroup list
ID          PID         STATUS      BUNDLE             CREATED                          OWNER
test        0           stopped     /opt/systemdtest   2020-04-21T10:40:55.998063538Z   root
[root@bogon systemdtest]# runc --systemd-cgroup kill -a test 0
WARN[0000] freezer not supported: open /sys/fs/cgroup/system.slice/runc-test.scope/cgroup.freeze: no such file or directory
ERRO[0000] lstat /sys/fs/cgroup/system.slice/runc-test.scope: no such file or directory
lstat /sys/fs/cgroup/system.slice/runc-test.scope: no such file or directory
[root@bogon systemdtest]# runc --systemd-cgroup ps test
ERRO[0000] container_linux.go:169: getting all container pids from cgroups caused "lstat /sys/fs/cgroup/system.slice/runc-test.scope: no such file or directory"
container_linux.go:169: getting all container pids from cgroups caused "lstat /sys/fs/cgroup/system.slice/runc-test.scope: no such file or directory"
[root@bogon systemdtest]#

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions