mirror of
https://github.com/alibaba/arthas.git
synced 2026-10-19 16:16:04 +00:00
When attaching from a k8s ephemeral debug container, the debug container shares the pid namespace but NOT the mount namespace with the target app container, which breaks the JDK attach mechanism. This adds cross mount namespace support (auto-gated by comparing /proc/<pid>/ns/mnt), so normal same-container / non-Linux usage is unaffected: - expose the target attach socket via a /proc/<pid>/root symlink - copy the full arthas home into the target container (incl. arthas-spy.jar, async-profiler, arthas.properties), chowned to the target uid/gid - clean up the temp arthas home on stop/destroy (gated by a marker file) - post-attach telnet port health check with a clear error pointing to arthas.log - as.sh: skip the user/owner consistency check when running as root