Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to interact with shell in Arthas

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to interact with shell in Arthas, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

Arthas (Alsace) launches a shell server inside the target java process during the bootstrap process. Shell server will listen to the telnet/http protocol on a specific port, parse and execute commands sent by the user.

The main class diagrams related to shell are as follows:

ShellServerImpl-shell server instance, which is responsible for listening to user requests.

The listener / parser corresponding to the TelnetTermServer-telnet protocol.

ShellImpl-for each connected user, a corresponding ShellImpl instance is created to manage the user's session.

JobControllerImpl-parses the command line input and creates it as the corresponding Job.

TermImpl-corresponds to each interactive terminal.

JobImpl/ProcessImpl-Encapsulation of the actual running command. ProcessImpl encapsulates process-related information, including various semaphore callback handler (interrupt/suspend/resume/background/foreground, etc.).

AnnotatedCommandImpl-A reference to running command.

The workflow related to Shell is shown below:

After receiving the user's request, TelnetTermServer creates a ShellImpl to track the user's session and triggers the readline operation on the TermImpl, waiting for the user to enter the request.

When the user enters the command, it is captured by ShellLineHandler, and then the corresponding ProcessImpl/JobImpl is created through ShellImpl/JobControllerImpl, as well as the context wrapper class CommandProcessImpl, and the command reference class AnnotatedCommandImpl. Finally, the actual command is run through JobImpl.run.

Thank you for reading this article carefully. I hope the article "how to interact with shell in Arthas" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report