Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您使用 net/ssh gem 在远程服务器中启动命令,并且该命令处于死锁状态,如何找到远程服务器中运行的进程的 pid 并杀死它?
net/ssh gem 支持这个吗?
好吧,如果你可以ssh进入远程服务器,你可以使用它来获取进程的 pid:
ssh
# Assuming the command you want to kill is a ruby program. # If the program is something else, say sparrow mail app, you should replace # ruby with sparrow below. ps -ax | grep ruby
然后,也许:
kill -9 <pid>