Skip to content

Fix the bug that a container may not have ps command#481

Closed
NitroCao wants to merge 1 commit intodocker:masterfrom
NitroCao:fix-avoid-using-ps
Closed

Fix the bug that a container may not have ps command#481
NitroCao wants to merge 1 commit intodocker:masterfrom
NitroCao:fix-avoid-using-ps

Conversation

@NitroCao
Copy link

@NitroCao NitroCao commented Sep 1, 2021

The reason why we should not execute ps command in containers:

  • some containers don't have ps command.
  • if a container shares the PID namespace with the host machine, the check command would report false positives.

The better way is to get the PID of the first process inside containers in the host PID namespace first, then find all processes whose PPID is the PID of the first process inside the container.

@konstruktoid konstruktoid self-assigned this Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments