title: Run tcpdump in background
body: <p>I have a problem , I'm make an experiment, so I'm trying to run python script over double ssh , so I have to capture traffic on every node then I made a function that I can run on each node. But the problem is that I can't run the script in order to start traffic after launched Tcpdump ( the prompt is hang after running tcp dump ). I tried many way to fix these issues but I still have note the best one. I just want a tick to run tcpdump in background and still running other command on the node. </p>
  
  <p>I already tried option "nohup" or putting "&amp;" at the end but I've got syntax error. I'm running this on Mac os.</p>
  
  <p>this is the python script shell in pom.sh :</p>
  
  <pre class="lang-py prettyprint-override"><code>def function(run-tcpdump):
      local interface="mon0"; shift
      local output="fit"; shift
  
      local USAGE="Usage; $FUNCNAME interface output [tcpdump extra args]"
  
    [ -z "$output" ] &amp;&amp; { echo $USAGE; return 1; }
  
      cd
      local command="tcpdump -n -U -w ${output}.pcap -i ${interface} " 
      echo "${interface} traffic tcpdump'ed into $pcap with command:"
      echo "$command"
      $command
  
      return 0
  
  </code></pre>
  
  <p>and this is where I call the function in pom.py:</p>
  
  <pre class="lang-py prettyprint-override"><code> run_sender = SshJob(
          node=sender,
          commands=[RunScript(auxiliary_script, "run-tcpdump"),
          RunScript(auxiliary_script, "run-sender", packets, size, period)],
  
          label="run-sender")
  
  </code></pre>
  
  <p>As you can see I have to run other function called run-sender to start sending packets but when the tcpdump function is launched the remote shell is hangged and I can't run the function "run-sender" anymore.</p>
  
  <p>this is the description below:</p>
  
  <p>Waiting for some interface to run on driver iwlwifi
  Using wlan device intel
  tcpdump: listening on mon0, link-type IEEE802_11_RADIO (802.11 plus radiotap header), capture size 262144 bytes</p>
  
  <p>NB/ Sorry for my badenglish :)<br>
  Thanks you all.</p>