Opened 17 years ago
Closed 17 years ago
#6428 closed defect (duplicate)
autoreload deamonizing and writing the pid to a file does not work.
Reported by: | djunky | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
i am not sure how autorelead works, but it seams that the line where daemon.daemonize() in standalone.py get called is executed twice if autorelead and daemonizing are enabled.
The result is, that daemon.daemonize() checks, if the process written in the pidfile still runs and exits.
The core of the problem sits in my oppinion in autoreload.py (_restart_with_reloader). a new process is spawned there the first time the main of autoreload gets called. this process is the one that exits because there is allready a daemonized version of the process running.
i guess it would be better to call autoreload.main there again spawning a new instance of sys.executable. That would prevent the second call to daemon.daemonize().
Note: running 6265 from svn on debian etch.
reproduce with: tracd -r —pidfile $PIDFILE -d ….
if the process is running after that you have fixed the bug.
if anyone has questions contact me at beschulz[a with that round thing attached to it]gmail.com
See #7049 for a recent discussion of that matter.