僵尸進程處理方式

Linux服務器上,多少會出現一些僵尸進程,下面介紹如何快速尋找和消滅這些僵尸進程的方法

首先,我們可以用top命令來查看服務器當前是否有僵尸進程,在下圖中可以看到僵尸進程數的提示,如果數字大于0,那么意味著服務器當前存在有僵尸進程
僵尸進程處理方式

下面,我們用ps和grep命令尋找僵尸進程

ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]'
命令注解:

-A 參數列出所有進程

-o 自定義輸出字段 我們設定顯示字段為 stat(狀態), ppid(進程父id), pid(進程id),cmd(命令)這四個參數

因為狀態為 z或者Z的進程為僵尸進程,所以我們使用grep抓取stat狀態為zZ進程

運行結果參考如下

Z 12334 12339 /path/cmd
這時,我們可以使用kill -HUP 12339來殺掉這個僵尸進程

運行后,可以再次運行ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]'來確認是否將僵尸進程殺死

如果kill 子進程的無效,可以嘗試kill 其父進程來解決問題,例如上面例子父進程pid是 12334,那么我們就運行

kill -HUP 12334

轉載于:https://blog.51cto.com/13272050/2073771

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278380.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278380.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278380.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

chromebook刷機_如何查看Chromebook的停產日期

chromebook刷機Google谷歌There comes a time in your Chromebook’s life when it no longer receives updates from Google. It’s inevitable and could be a lot sooner than you think. Here’s how to see your Chromebook’s scheduled end-of-life date. Chromebook一生…

C#將unix時間戳轉換成.net的DateTime類型的代碼

下面的內容是關于C#將unix時間戳轉換成.net的DateTime類型的內容。 DateTime epoch new DateTime(1970,1,1,0,0,0,0, DateTimeKind.Utc);DateTime myDate epoch.AddSeconds(1258598728).toLocalTime(); 轉載于:https://www.cnblogs.com/odsxe/p/10338494.html

【活動】AI人工智能技術沙龍 |杭州站

AI人工智能技術沙龍 |杭州站將于2018年3月3號在浙江杭州市文一西路1818-2號中國(杭州)人工智能小鎮舉辦由袋鼠云、七牛云及“因特鏈”社區的老師為大家帶來AI純技術干貨分享另有區塊鏈和AI人工智能技術融合技術主題1活動安排時間:2018年3月3號…

如何在Google文檔中的圖片周圍換行

If you want to insert an image or object into a document, it’s relatively simple. However, positioning and getting them to stay where you want can be frustrating. The wrap text feature in Google Docs makes all of this more manageable. 如果要將圖像或對象插…

mysql的left函數

1、LEFT()函數是一個字符串函數,它返回具有指定長度的字符串的左邊部分。 LEFT(Str,length); 接收兩個參數: str:一個字符串; length:想要截取的長度,是一個正整數; 2、示例: SELECT…

如何在Linux上使用history命令

Fatmawati Achmad Zaenuri/ShutterstockFatmawati Achmad Zaenuri / ShutterstockLinux’s shell saves a history of the commands you run, and you can search it to repeat commands you’ve run in the past. Once you understand the Linux history command and how to u…

mysql導入sqlserver數據庫表

原文:https://zhidao.baidu.com/question/1114325744502691499.html 在Navicat for MySQL 管理器中,創建目標數據庫(注意:因為是點對點的數據導入,要求sql server 中要導出的數據庫名稱和要導入到Mysql 中的數據庫的名字相同)點擊…

AppleScript

AppleScript 后綴名scpt do shell script "shell腳本"轉載于:https://www.cnblogs.com/yangwenhuan/p/10338580.html

ER圖三元聯系簡介

數據庫設計時,遇到三元聯系怎樣確定,下面做個簡單介紹。 一、確定聯系 三元聯系共 4 種情況: 1 : 1 : 11 : 1 : N1 : M : NM : N : P1 &#xff1…

mac自帶郵箱導出郵件_如何將電子郵件從Mac Mail導出到Notes應用程序

mac自帶郵箱導出郵件Khamosh PathakKhamosh PathakIf you use the Mail app regularly, you’re used to archiving or flagging emails for later. But what if you want to save a particular message for future reference in the Notes app? Well, there’s a work-around…

luogu P3380 【模板】二逼平衡樹(樹套樹)

恭喜你 以分塊的姿勢通過了此題 #include<cmath> #include<cstdio> #include<algorithm> #define inf (2147483647) using namespace std; const int N5e450; struct FK {int l,r;} K[500]; int n,m,T,sqr,ans,a[N],b[N],fa[N]; void work1(int l,int r,int …

Appium使用Python運行appium測試的實例

Appium使用Python運行appium測試的實例 一&#xff0e; Appium之介紹 https://testerhome.com/topics/8038 詳情參考-- https://testerhome.com/topics/8038 Appium是一個移動端的自動化框架&#xff0c;可用于測試原生應用&#xff0c;移動網頁應用和混合型應用&#xff0c;且…

ubuntu 任務欄監視器_從系統任務欄監視Google服務

ubuntu 任務欄監視器Are you looking for an app that sits in your System Tray and will notify you when you have new items in your Google accounts? Now you can easily monitor all of your favorite Google services with Googsystray. 您是否正在尋找一個位于系統任…

Java發送郵件(帶附件)

實現java發送郵件的過程大體有以下幾步&#xff1a; 準備一個properties文件&#xff0c;該文件中存放SMTP服務器地址等參數。利用properties創建一個Session對象利用Session創建Message對象&#xff0c;然后設置郵件主題和正文利用Transport對象發送郵件需要的jar有2個&#x…

google天氣預報接口_將天氣預報添加到谷歌瀏覽器

google天氣預報接口Are you looking for a quick and easy way to see your local weather forecast in Google Chrome? Then you will definitely want to take a good look at the AccuWeather Forecast extension. 您是否正在尋找一種快速簡便的方法來在Google Chrome瀏覽器…

hive中任意相鄰時間段數據獲取

通過sql語句獲取相鄰時段數據不比通過其它編程語言&#xff0c;因為sql里面沒有for循環&#xff0c;故在實現時需要增加一份副表數據&#xff0c;這里對該方法做一個記錄。背景&#xff1a;獲取2017年全年平臺用戶進出貴州省的次數&#xff08;分為進港次數和出港次數&#xff…

strace命令用法

-tt 在每行輸出的前面&#xff0c;顯示毫秒級別的時間 -T 顯示每次系統調用所花費的時間 -v 對于某些相關調用&#xff0c;把完整的環境變量&#xff0c;文件stat結構等打出來。 -f 跟蹤目標進程&#xff0c;以及目標進程創建的所有子進程 -e 控制要跟蹤的事件和跟蹤行為,比如指…

在谷歌瀏覽器中自動翻譯文本

Do you need a quick and simple way to understand an unfamiliar language while browsing the Internet? Then join us as we take a look at the Auto-Translate extension for Google Chrome. 您需要一種快速簡單的方法來瀏覽Internet時理解一種陌生的語言嗎&#xff1f;…

知識點025-服務器的基礎優化腳本

2019獨角獸企業重金招聘Python工程師標準>>> 腳本是借鑒老男孩培訓機構的&#xff0c; 感謝感謝~ mkdir -p /server/scripts cat >> /server/scripts/env.sh <<END #!/bin/bash #author Xiongchao #qq 704816384 #mail 704816384qq.com #selinux off…

PHP實現微信隨機紅包算法和微信紅包的架構設計簡介

微信紅包的架構設計簡介&#xff1a; 原文&#xff1a;https://www.zybuluo.com/yulin718/note/93148 來源于QCon某高可用架構群整理&#xff0c;整理朱玉華。 背景&#xff1a;有某個朋友在朋友圈咨詢微信紅包的架構&#xff0c;于是乎有了下面的文字&#xff08;有誤請提出&a…