问题描述
NFS服务故障, ps到的进程显示状态为D, 无法使用 kill 杀掉.
了解ps
ps是process status的缩写, 用于列出系统中当前运行的进程快照.
root@kub3:/home/nfs# ps -aux | grep nfs
root 1937 0.0 0.0 0 0 ? S< Jul16 0:00 [nfsd4_callbacks]
root 1940 0.0 0.0 0 0 ? D Jul16 0:00 [nfsd]
root 1941 0.0 0.0 0 0 ? D Jul16 0:00 [nfsd]
root 1942 0.0 0.0 0 0 ? D Jul16 0:01 [nfsd]
root 1943 0.0 0.0 0 0 ? D Jul16 0:02 [nfsd]
root 1944 0.0 0.0 0 0 ? D Jul16 0:03 [nfsd]
root 1945 0.0 0.0 0 0 ? D Jul16 0:06 [nfsd]
root 1946 0.0 0.0 0 0 ? D Jul16 0:50 [nfsd]
root 1947 0.0 0.0 0 0 ? D Jul16 4:25 [nfsd]
root 3080 0.0 0.0 0 0 ? S< Jul16 0:00 [nfsiod]
root 10578 0.0 0.0 14224 920 pts/18 S+ 11:57 0:00 grep --color=auto nfs
root 13380 0.0 0.2 37648 16904 ? Ssl Jul26 8:48 /nfs-client-provisioner
root 24271 0.0 0.0 16300 892 ? D Sep28 0:00 ls --color=auto /home/nfs/admin-d2069c-storage-mysql-2-pvc-ce20ad71-c2f4-11e8-b599-0050568eef9f/mysql/
root 25956 0.0 0.0 7316 700 pts/17 D+ 10:55 0:00 rm -rf /home/nfs/admin-d2069c-storage-mysql-2-pvc-ce20ad71-c2f4-11e8-b599-0050568eef9f/
ps进程状态码
ps出的进程状态码共有5种:
R 运行 runnable :运行(正在运行或在运行队列中等待)
D uninterruptible sleep (usually IO), 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)
S sleeping, 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号)
T traced or stopped, 停止(进程收到SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU信号后停止运行运行)
Z a defunct (”zombie”) process, 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放)
ps命令参数