Site icon New Generation Enterprise Linux

Peer into another process namespace to see what it is hiding

Container Basics On Linux (Namespaces/Cgroups)

Peer into another process namespace to see what it is hiding

đź§© The Challenge

Trying to troubleshoot a containerized app that seems to be running but isn’t responding to anything, and your host-level ps commands are just showing a mess of PIDs you don’t recognize. I have spent way too much time staring at isolated process lists that told me absolutely nothing about the actual container state.

đź’ˇ The Fix

You can use nsenter to jump into the PID namespace of any running container process, which lets you run commands as if you were sitting right inside that container’s skin. It is the fastest way to see what your application actually thinks is happening.

nsenter -t <pid> -n -p ps aux

⚙️ Why It Works

By targeting the process ID of your container’s entrypoint, you are telling the kernel to switch your own shell’s view into that specific namespace, exposing the hidden world of the container’s process tree.

🚀 Pro-Tip: Stick the -m flag in there too if you need to inspect the mounted filesystems inside the container while you are at it.

Linux Tips & Tricks | © ngelinux.com | 9/30/2026

0 0 votes
Article Rating
Exit mobile version