Re: [CherryPy] #902: cherryd script doesn't respawn correctly in daemon mode

16 views
Skip to first unread message

CherryPy

unread,
Feb 9, 2009, 7:14:15 PM2/9/09
to cherrypy...@googlegroups.com
#902: cherryd script doesn't respawn correctly in daemon mode
---------------------------------------+------------------------------------
Reporter: cher...@robince.ftml.net | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Resolution:
Keywords: cherryd |
---------------------------------------+------------------------------------
Comment (by cher...@robince.ftml.net):

I just noticed the
{{{
cherrypy.config.update({'engine.autoreload_on': False})
}}}
option used for fastcgi and scgi. Including this in my application config
seems to fix the problem.

Perhaps this should be taken added to the `if daemonize` block as well.

--
Ticket URL: <http://www.cherrypy.org/ticket/902>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework

CherryPy

unread,
Feb 9, 2009, 7:08:09 PM2/9/09
to cherrypy...@googlegroups.com
#902: cherryd script doesn't respawn correctly in daemon mode
---------------------------------------+------------------------------------
Reporter: cher...@robince.ftml.net | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Keywords: cherryd
---------------------------------------+------------------------------------
I am using CherryPy-3.1.1-py2.5.egg installed via easy_install on Ubuntu.

I am using Cherrypy as a wsgi server, and am trying to daemonise it using
cherryd. I am using paste.URLParser to dynamically dispatch to files on
disk.

If I remove a file that has already been accessed the following happens if
cherryd is started non-daemonised:

{{{
robince@penguin:~/webs$ ./cherryd -i cherrymain
[09/Feb/2009:23:54:08] ENGINE Listening for SIGHUP.
[09/Feb/2009:23:54:08] ENGINE Listening for SIGTERM.
[09/Feb/2009:23:54:08] ENGINE Listening for SIGUSR1.
[09/Feb/2009:23:54:08] ENGINE Bus STARTING
[09/Feb/2009:23:54:08] ENGINE Started monitor thread '_TimeoutMonitor'.
[09/Feb/2009:23:54:08] ENGINE Started monitor thread 'Autoreloader'.
[09/Feb/2009:23:54:08] ENGINE Serving on 0.0.0.0:8001
[09/Feb/2009:23:54:08] ENGINE Bus STARTED
[09/Feb/2009:23:54:34] ENGINE Restarting because /home/robince/webs/sum.py
changed.
[09/Feb/2009:23:54:34] ENGINE Stopped thread 'Autoreloader'.
[09/Feb/2009:23:54:34] ENGINE Bus STOPPING
[09/Feb/2009:23:54:34] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8001)) shut down
[09/Feb/2009:23:54:34] ENGINE Stopped thread '_TimeoutMonitor'.
[09/Feb/2009:23:54:34] ENGINE Bus STOPPED
[09/Feb/2009:23:54:34] ENGINE Bus EXITING
[09/Feb/2009:23:54:34] ENGINE Bus EXITED
[09/Feb/2009:23:54:34] ENGINE Waiting for child threads to terminate...
[09/Feb/2009:23:54:34] ENGINE Re-spawning ./cherryd -i cherrymain
[09/Feb/2009:23:54:34] ENGINE Listening for SIGHUP.
[09/Feb/2009:23:54:34] ENGINE Listening for SIGTERM.
[09/Feb/2009:23:54:34] ENGINE Listening for SIGUSR1.
[09/Feb/2009:23:54:34] ENGINE Bus STARTING
[09/Feb/2009:23:54:34] ENGINE Started monitor thread '_TimeoutMonitor'.
[09/Feb/2009:23:54:34] ENGINE Started monitor thread 'Autoreloader'.
[09/Feb/2009:23:54:34] ENGINE Serving on 0.0.0.0:8001
[09/Feb/2009:23:54:34] ENGINE Bus STARTED
}}}

So it seems like the change to the file is detected and the server
respawns.

However, if I start it with the -d flag, I get the following log:
{{{
robince@penguin:~/webs$ cat cp_error.log
[09/Feb/2009:23:58:13] ENGINE Listening for SIGHUP.
[09/Feb/2009:23:58:13] ENGINE Listening for SIGTERM.
[09/Feb/2009:23:58:13] ENGINE Listening for SIGUSR1.
[09/Feb/2009:23:58:13] ENGINE Bus STARTING
[09/Feb/2009:23:58:13] ENGINE Forking once.
[09/Feb/2009:23:58:13] ENGINE Daemonized to PID: 32411
[09/Feb/2009:23:58:13] ENGINE Forking twice.
[09/Feb/2009:23:58:13] ENGINE Started monitor thread '_TimeoutMonitor'.
[09/Feb/2009:23:58:13] ENGINE Started monitor thread 'Autoreloader'.
[09/Feb/2009:23:58:13] ENGINE Serving on 0.0.0.0:8001
[09/Feb/2009:23:58:13] ENGINE Bus STARTED
[09/Feb/2009:23:59:40] ENGINE Restarting because /home/robince/webs/sum.py
changed.
[09/Feb/2009:23:59:40] ENGINE Stopped thread 'Autoreloader'.
[09/Feb/2009:23:59:40] ENGINE Bus STOPPING
[09/Feb/2009:23:59:40] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8001)) shut down
[09/Feb/2009:23:59:40] ENGINE Stopped thread '_TimeoutMonitor'.
[09/Feb/2009:23:59:40] ENGINE Bus STOPPED
[09/Feb/2009:23:59:40] ENGINE Bus EXITING
[09/Feb/2009:23:59:40] ENGINE Bus EXITED
[09/Feb/2009:23:59:40] ENGINE Waiting for child threads to terminate...
[09/Feb/2009:23:59:40] ENGINE Re-spawning ./cherryd -d -i cherrymain
}}}

But it doesn't respawn. The server is just shut down - there is no longer
any Python running.

CherryPy

unread,
Aug 5, 2009, 1:12:09 AM8/5/09
to cherrypy...@googlegroups.com
#902: cherryd script doesn't respawn correctly in daemon mode
---------------------------------------+------------------------------------
Reporter: cher...@robince.ftml.net | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone: 3.2
Component: CherryPy code | Resolution:
Keywords: cherryd |
---------------------------------------+------------------------------------
Changes (by fumanchu):

* milestone: => 3.2

CherryPy

unread,
Aug 15, 2009, 3:09:28 PM8/15/09
to cherrypy...@googlegroups.com
#902: cherryd script doesn't respawn correctly in daemon mode
---------------------------------------+------------------------------------
Reporter: cher...@robince.ftml.net | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone: 3.1.2
Component: CherryPy code | Resolution:
Keywords: cherryd |
---------------------------------------+------------------------------------
Changes (by fumanchu):

* milestone: 3.2 => 3.1.2

Comment:

This works in 3.2. Moving to 3.1.x milestone.
Reply all
Reply to author
Forward
0 new messages