創建下面的函數來關機cherrypy
:我如何關閉CherryPy的
import cherrypy
cherrypy.engine.exit()
的文件的名稱:shutdown.py
。然後我在命令行中輸入命令python shutdown.py
。以下消息顯示:
[06/Sep/2014:11:28:22] ENGINE Bus STOPPING
[06/Sep/2014:11:28:22] ENGINE HTTP Server None already shut down
[06/Sep/2014:11:28:22] ENGINE No thread running for None.
[06/Sep/2014:11:28:22] ENGINE No thread running for None.
[06/Sep/2014:11:28:22] ENGINE Bus STOPPED
[06/Sep/2014:11:28:22] ENGINE Bus EXITING
[06/Sep/2014:11:28:22] ENGINE Bus EXITED
但是,CherryPy仍在運行。那麼我如何關閉CherryPy?
另外,如果我有多個cherrypy服務器在同一時間運行? shutdown.py
是否會殺死所有人?
你正在運行哪個操作系統?你需要使用信號來殺死另一個進程。沒有全球cherrypy服務器。 – cyraxjoe 2014-09-06 05:36:43
操作系統:Ubuntu 14.04 LTS。 – 2014-09-06 09:26:54