title: spawning multiple python processes/daemons of same name (different args)
body: <p>I am trying to create independent processes in python. These processes are a python script that I want to have multiple instances of, but instantiated with different arguments.
  Simply, from a for loop, I am calling subprocess.Popen(), but with args varying accordingly:</p>
  
  <pre><code>for d in mylist:
      subprocess.Popen(['./subscriber.py', d.arg1, a.arg2, d.arg3])
  </code></pre>
  
  <p>In subscriber.py, I have code that "daemonizes" the process as per various <a href="http://code.activestate.com/recipes/66012-fork-a-daemon-process-on-unix/" rel="nofollow">recipes</a>
  Alternatively to this, I have also tried to launch my subscriber.py with:</p>
  
  <pre><code>for d in mylist:
      p = multiprocessing.Process(target=subscriber.start,
                                  args=(d.arg1, d.arg2, d.arg3))
      p.daemon=True
      p.start()
  </code></pre>
  
  <p>My script also uses python logging to write to a common log file.</p>
  
  <p>What happens with either method, is that only the process from the last iteration of my loop is left actually running. All I need is to have these background daemons running "forever", but I can only ever get 1 instance! [edit] Importantly, I want the calling thread to terminate, leaving this bunch of running daemons behind, running..</p>
  
  <p>I have googled far and wide, on stackoverflow and elsewhere, can't seem to find a similar example. Perhaps its my python novice-ness .. is my approach completely incorrect?</p>
  
  <p>Environment: - Python-2.7, ubuntu linux</p>