title: supervisor curl command failing with exit 56 error
body: <p>I have this curl cmd I run locally on OSX that completes successfully:</p>
  
  <pre><code> curl -XPOST http://192.168.59.103:9200/inventoryindex
  
   {"acknowledged":true}
  </code></pre>
  
  <p>BUT when it's run from supervisor in docker it fails...ummmmm</p>
  
  <pre><code> 2014-08-16 14:24:38,838 INFO supervisord started with pid 1
   2014-08-16 14:24:39,842 INFO spawned: 'curl' with pid 9
   2014-08-16 14:24:39,843 INFO spawned: 'elasticsearch' with pid 10
   2014-08-16 14:24:39,844 INFO spawned: 'sshd' with pid 11
   2014-08-16 14:24:39,853 INFO exited: curl (exit status 56; not expected)
  </code></pre>
  
  <p>I've tried a couple different variations of the command with same results: Here is the latest version of the supervisor command:</p>
  
  <pre><code> [program:curl]
   command=curl --header "Content-Type:application/json" -XPOST 'http://192.168.59.103:9200/inventoryindex'
  </code></pre>
  
  <p>Any thoughts? Thanks!</p>
  
  <p>[UPDATE] So, looking at the info entries I <em>think</em> the problem is that supervisor spawns the curl process before elasticsearch has a chance to boot up. I added priority settings to make the curl process spawn last and increased the retry attempts hoping that will mitigate the timing.</p>
  
  <pre><code> [program:curl]
   command=curl -v --header "Content-Type:application/json" -XPOST 'http://192.168.59.103/:9200/inventoryindex' 
   startretries=5
   priority=1000
  </code></pre>
  
  <p>Also I tried localhost:9200 &amp; 0.0.0.0:9200...zilch. It looks like the spawn order is correct now yet curl is still not completing successfully. </p>
  
  <pre><code> 2014-08-16 22:46:50,282 INFO supervisord started with pid 1
   2014-08-16 22:46:51,285 INFO spawned: 'elasticsearch' with pid 10
   2014-08-16 22:46:51,288 INFO spawned: 'rabbitmq-server' with pid 11
   2014-08-16 22:46:51,290 INFO spawned: 'sshd' with pid 12
   2014-08-16 22:46:51,294 INFO spawned: 'curl' with pid 17
   2014-08-16 22:46:51,341 INFO exited: curl (exit status 7; not expected)
  </code></pre>
  
  <p>The retry increase tries again after elastic is running...should be ok now for curl but....zilch.</p>
  
  <pre><code> 2014-08-16 22:46:52,340 INFO success: elasticsearch entered RUNNING state, process has stayed up for &gt; than 1 seconds (startsecs)
   ...
   2014-08-16 22:46:53,346 INFO spawned: 'curl' with pid 143
   2014-08-16 22:46:53,372 INFO exited: curl (exit status 7; not expected)
  </code></pre>
  
  <p>[UPDATE 2]</p>
  
  <ol>
  <li><p>docker ps (OSX)</p>
  
  <pre><code> CONTAINER ID        IMAGE                   COMMAND                CREATED               STATUS              PORTS                                                                                                                          NAMES
   13c872a3ffa7        team1/image1:rabbit   /usr/bin/supervisord   About a minute ago   Up About a minute   22/tcp, 4369/tcp, 5672/tcp, 0.0.0.0:9001-&gt;9001/tcp, 0.0.0.0:9200-&gt;9200/tcp, 0.0.0.0:9300-&gt;9300/tcp, 0.0.0.0:15672-&gt;15672/tcp   elegant_fermi
  </code></pre></li>
  <li><p>docker ps (boot2docker)</p>
  
  <pre><code>CONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS              PORTS                                                                                                                          NAMES
  13c872a3ffa7        team1/image1:rabbit   /usr/bin/supervisord   5 minutes ago       Up 5 minutes        22/tcp, 4369/tcp, 5672/tcp, 0.0.0.0:9001-&gt;9001/tcp, 0.0.0.0:9200-&gt;9200/tcp, 0.0.0.0:9300-&gt;9300/tcp, 0.0.0.0:15672-&gt;15672/tcp   elegant_fermi       
  </code></pre></li>
  <li><p>netstat -tunlp ... when I attach to 13c872a3ffa7 from within boot2docker (ssh) there isn't a command prompt available to enter the netstat command so I run the command after ssh'd into boot2docker:</p>
  
  <pre><code>netstat: can't scan /proc - are you root?
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
  tcp        0      0 :::2375                 :::*                    LISTEN      -
  tcp        0      0 :::22                   :::*                    LISTEN      -
  </code></pre></li>
  </ol>
  
  <p>I ssh'd as docker user (I thought the user had root auth)</p>
  
  <p>Chris...slight change, same result...went from curl to python client. Here's the git link to the code. Thanks!</p>
  
  <p>[UPDATE 3] nsenter installed</p>
  
  <ol>
  <li><p>from within boot2docker:</p>
  
  <p>a.  get container id via docker ps</p>
  
  <p>b. get PID</p>
  
  <pre><code>  PID=`docker inspect --format '{{ .State.Pid }}' $CONTAINER_ID`
  </code></pre>
  
  <p>c. run nsenter</p>
  
  <pre><code> nsenter -t $PID  -m -u -n -i -p -w
   nsenter: cannot open /proc/28160/ns/ipc: Permission denied
  </code></pre></li>
  </ol>
  
  <p>HEAVY SIGH</p>
  
  <p>If I sudo nsenter it switches to root, the previously set vars are wiped and the prompt has no knowledge of the docker command:</p>
  
  <pre><code>  nsenter -t 28160 -m -u -n -i -p -w
    nsenter: cannot open /proc/28160/ns/ipc: No such file or directory
  </code></pre>