<p>默认情况下,有一个用于CherryPy的<a href="http://docs.cherrypy.org/stable/refman/process/plugins/daemonizer.html" rel="noreferrer">Daemonizer</a>插件,它对于启动CherryPy很有用,但对于简单的情况,最简单的方法是使用cherryd脚本:</p>
<pre><code>> cherryd -h
Usage: cherryd [options]
Options:
-h, --help show this help message and exit
-c CONFIG, --config=CONFIG
specify config file(s)
-d run the server as a daemon
-e ENVIRONMENT, --environment=ENVIRONMENT
apply the given config environment
-f start a fastcgi server instead of the default HTTP
server
-s start a scgi server instead of the default HTTP server
-i IMPORTS, --import=IMPORTS
specify modules to import
-p PIDFILE, --pidfile=PIDFILE
store the process id in the given file
</code></pre>
<p>就init.d脚本而言,我认为有一些例子可以通过谷歌进行搜索。</p>
<p>而<code>cherryd</code>在您的:</p>
<blockquote>
<p>virtualenv/lib/python2.7/site-packages/cherrypy/cherryd</p>
</blockquote>
<p>或在:<a href="https://bitbucket.org/cherrypy/cherrypy/src/default/cherrypy/cherryd" rel="noreferrer">https://bitbucket.org/cherrypy/cherrypy/src/default/cherrypy/cherryd</a></p>