它还将通过单个配置更改启动 Web 服务器的多个实例(如果适合您的架构),甚至管理共享一个套接字的多个 FastCGI 实例。
Use supervisor. It's much easier than rolling your own service management code. It includes monitoring, control, limited restarts, status logging, custom event notifications and an XML-RPC API for controlling supervisor programmatically.
It'll also start multiple instances of your web server — if that suits your architecture — with a single config change, and even manage multiple FastCGI instances that share the one socket.
发布评论
评论(2)
在后台启动您的程序:
nohup ./server.py &
停止服务的首选方法是发出一个以服务的 PID 作为参数的终止命令。
聚苯乙烯
评论中提到的 start-stop-daemon 更好,但稍微复杂一些。
Start your program in background with:
nohup ./server.py &
The preferred way to stop your service is to issue a kill command with your service's PID as argument.
P.S.
start-stop-daemon metioned in comments is better but slightly more complex.
使用supervisor。这比滚动您自己的服务管理代码要容易得多。它包括监视、控制、有限重启、状态记录、自定义事件通知和用于以编程方式控制 Supervisor 的 XML-RPC API。
它还将通过单个配置更改启动 Web 服务器的多个实例(如果适合您的架构),甚至管理共享一个套接字的多个 FastCGI 实例。
Use supervisor. It's much easier than rolling your own service management code. It includes monitoring, control, limited restarts, status logging, custom event notifications and an XML-RPC API for controlling supervisor programmatically.
It'll also start multiple instances of your web server — if that suits your architecture — with a single config change, and even manage multiple FastCGI instances that share the one socket.