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 correctly check and kill stopped process under Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to correctly check and kill stopped processes under Linux". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Under Linux, the top command can be used to view stopped processes. However, you cannot view the details of the stopped process.

ps -e j | grep T

The STAT state of a stopped process is T. Generally speaking, processes have the following state codes:

D uninterruptible sleep (usually IO)I Idle kernel threadR running or runnable (on run queue)S interruptible sleep (waiting for an event to complete)T stopped by job control signalt stopped by debugger during the tracingW paging (not valid since the 2.6.xx kernel)X dead (should never be seen)Z defunct ("zombie") process, terminated but not reaped by its parentfor BSD formats and when the stat keyword is used, additionalrs may be displayed:for real-time and custom IO)s is a session leaderl is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)+ is in the foreground process group

Generally, there are five status codes:

D uninterruptible sleep (usually IO) R runnable (on run queue) S interrupting sleeping T traced or stopped Z dead a defunct ("zombie") process

ps -A -ostat,ppid,pid,cmd| grep -e '^[T]' View stopped process information and then kill the process completely with the kill command. As follows:

# ps -A -ostat,ppid,pid,cmd | grep -e '^[T]'T 6777 8635 more alert_pps.logT 6777 9654 tail -60f alert_pps.logT 6777 10724 top# kill -9 8635# ps -A -ostat,ppid,pid,cmd | grep -e '^[T]'T 6777 9654 tail -60f alert_pps.logT 6777 10724 top# kill -9 9654# kill -9 10724"How to correctly check and kill stopped process under Linux" is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

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

Development

Wechat

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

12
Report