Not all processes could be identified, non-owned process info will not be show解決辦法

Not all processes could be identified, non-owned process info will not be show解決辦法
背景
今天在調試腳本的時候,打印出的日誌中出現了 “Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.” 錯誤

原因

經過排查後發現腳本中有運行 netstat 查看進程的命令,因爲是在普通用戶下執行的 netstat命令,所以權限不足

解決辦法
登陸root用戶,執行如下命令,讓其它用戶瞬間獲得文件所有者的權限

# chmod +s /bin/netstat

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章