Edgewall Software

Opened 16 years ago

Last modified 16 years ago

#7049 closed defect

tracd: --daemonize and --auto-reload don't cohabitate happily — at Initial Version

Reported by: bschmer@… Owned by: Jonas Borgström
Priority: normal Milestone: 0.11.1
Component: web frontend/tracd Version:
Severity: normal Keywords: patch
Cc: remy.blank@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When using —daemonize and —auto-reload at the same time the background daemon process exits neatly without any explanation. Having done some digging around, it seems that the root of the problem is in _restart_with_reloader() at utils/autoreload.py line 55. When os.spawnve is called, it uses the full sys.argv which includes the —daemonize argument. My fix for this is: eng:util qa$ diff -c autoreload.py autoreload.py.save * autoreload.py Tue Mar 25 16:52:18 2008 —- autoreload.py.save Tue Mar 25 16:14:51 2008 * * 55,63

def _restart_with_reloader():

while True:

args = [sys.executable] + sys.argv

  • if args.count('—daemonize'):
  • # Stop the insanity
  • args.remove('—daemonize')

if sys.platform == 'win32':

args = % arg for arg in args

new_environ = os.environ.copy()

—- 55,60 —— eng:util qa$

With the logic for removing these arguments being:

  • The main program already daemonized, so it doesn't need to be done again
  • Things started working more like what I expected after making the change

Change History (0)

Note: See TracTickets for help on using tickets.