通常情况下,我想杀死进程,我相信已经改变了命令名称( 我想通过setproctitle()或类似的东西 )。
显然pkill , pgrep和朋友不会读新的命令名称(即ruby进程重命名其命令,pkill仍然认为它是ruby而不是delayed_job )。
不过ps和h?top做。
是我唯一的手段greping / awking ps杀死这些types的进程还是我错过了什么?
尝试使用ps -f , pgrep -f和pkill -f 。
从各自的手册页:
ps -f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be printed.
–
pgrep/pkill -f, --full The pattern is normally only matched against the process name. When -f is set, the full command line is used.