3

我使用金字塔和 pserve 运行 Gunicorn,如下所示:

pserve production.ini

生产.ini

[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 8080
workers = 3
worker_class = gevent
daemon = true

它返回PID

Starting server in PID XXXXX.

但我不能通过跑步来杀死它

# kill XXXXX
-bash: kill: (XXXXX) - No such process

或者

# pserver --stop-daemon XXXXX
No PID File exists in pyramid.pid

到目前为止,我一直在使用

pkill pserve

但是现在,我有多个服务器正在运行,所以它会杀死我所有的服务器。

我怎样才能杀死特定的正在运行的服务器?

4

1 回答 1

2

if the server is actually running, I'd try something like that.

ps -ax | grep pserv[e] 

It will show all process with their pid on the first column. If something match what you are looking for. You can kill it. The x option should show the command line used to start the process. If you're lucky it will show that it was started in "that" directory or with "that" config file.

otherwise, it might be possible to check which process is listening to which port and getting its pid.

于 2012-10-10T02:45:28.660 回答